☰ INDEX
Anthrax
Antigen & Antibody
Antigen - Antibody Reactions
Antimicrobial Susceptibility Testing & Genetics
Autoimmunity
Bacteria causing UTI
Bacterial Atypical Pneumonia
Bacterial Meningitis
Bacterial Typical Pneumonia
Cholera
Culture & Identification
DNA Viruses Skin Infections
Deep Fungal Skin Infections
Diphtheria
E. Coli Diarrhoeal Disease
Fungal Pneumonia-Part 1
Fungal Pneumonia-Part 2
Gas Gangrene
General Bacteriology (GB)
General Mycology
General Parasitology Part-1
General Virology Part-1
General Virology Part-2
Genital Ulcerative Diseases
HEPATITIS
Helminthic Gastroenteritis
Hepatic Fascioliasis
Hypersensitivity
Immunity
Immunodeficiency Disorders
Introduction
Leprosy
Microscopy & Staining
Miscellaneous - Slow Viral Diseases
Miscellaneous – Fungal Food Poisoning
Miscellaneous- Neurotoxin related diseases
Morphology & Growth of Bacteria
Nocardiosis
Parasitic Encephalitis
Parasitic Pneumonia
Parasitic Skin Infections
Peptic Ulcer Disease
Plague
Protozoal Gastroenteritis
Pseudomembranous Colitis
RNA Corona Virus
RNA Viruses Skin Infections
Rickettsia & Related Diseases
Scientists
Staphylococcal Skin Infections
Sterilization & Disinfection (Chemical method)
Sterilization & Disinfection (Physical method)
Streptococcal Skin Infections
Superficial Fungal Skin Infections
Transplant Immunology
Tuberculosis
Typhoid Fever
Urethritis
Vaginitis
Viral Encephalitis
Viral Gastro Enteritis
Viral Hemorrhagic Fever
Viral Meningitis
Viral Pneumonia-Part 1
Viral Pneumonia-Part 2
Whooping Cough
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 34-year-old man comes to the emergency department due to 2 days of fever, malaise, and myalgia. He has also had severe shortness of breath and cough. The patient works in the mail room at a large company, does not smoke cigarettes, and drinks alcohol occasionally. Chest imaging shows lung infiltrates and a prominent widening of the mediastinum. Sputum and blood cultures yield large, gram-positive rods that form colonies resembling a \"Medusa head.\" Which of the following is the most likely bacterial virulence factor contributing to this patient's condition?", "options": [{"label": "A", "text": "Antiphagocytic D-glutamate capsule", "correct": true}, {"label": "B", "text": "Antiphagocytic polysaccharide capsule", "correct": false}, {"label": "C", "text": "IgG-binding, outer membrane protein", "correct": false}, {"label": "D", "text": "Intracellular polyphosphate granules", "correct": false}], "correct_answer": "A. Antiphagocytic D-glutamate capsule", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antiphagocytic D-glutamate capsule Bacillus anthracis is a large, nonmotile, nonhemolytic, gram-positive rod that forms colonies in culture with multiple curled extensions at the edges that resemble a \"Medusa head.\" It has an antiphagocytic polypeptide glutamate capsule.</p>\n<p><strong>Highyeild:</strong></p><p>Bacillus Anthracis: Because the organism proliferates in soil contaminated with manure, pasture-grazing herbivores such as sheep, cattle, and horses are at greatest risk for infection. However, transmission to humans occasionally occurs when B anthracis spores are inhaled, ingested, or inoculated into the skin. I nhalation of spores into the alveoli causes pulmonary anthrax. Alveolar macrophages phagocytose the spores and bring them to mediastinal lymph nodes, where the spores germinate into vegetative rods and multiply. The vegetative form of the bacteria contains a polypeptide capsule composed of D-glutamic acid, which is antiphagocytic. anthracis rods also produce a potent exotoxin complex composed of edema factor, lethal factor, and protective antigen, which enter host cells and cause cell death. Initial manifestations of infection are nonspecific (eg, myalgia, fever, malaise), but the proliferation of the bacteria in the mediastinum eventually causes hemorrhagic mediastinitis (often visible on chest x-ray as a widened mediastinum). Subsequent dissemination through the bloodstream causes shock, brain edema/haemorrhage, and death. Although pulmonary anthrax is quite rare, it can be seen in individuals who handle contaminated hides or animal hair (\" Woolsorter's disease\") or those exposed to aerosolized biologic weapons (eg, opening contaminated mail).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Many bacteria (eg, Streptococcus pneumoniae) are resistant to phagocytosis due to the presence of a polysaccharide capsule. However, B anthracis has a polypeptide, not a polysaccharide capsule. Option C. Staphylococcus aureus produces protein A , which binds the Fc portion of IgG. This inhibits opsonization and complement-mediated killing of the bacteria. Option D. I ntracellular polyphosphate granules are characteristic of Corynebacterium diphtheriae ; they can be visualized on microscopy after growing the pathogen on the Loeffler medium and staining it with methylene blue.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Anthrax is a serious infectious disease caused by gram-positive, rod-shaped bacteria known as Bacillus anthracis. It occurs naturally in soil and commonly affects domestic and wild animals around the world. People can get sick with anthrax if they come in contact with infected animals or contaminated animal products. All of the following are true about bacillus anthrax except:", "options": [{"label": "A", "text": "Plasmid is responsible for toxin production", "correct": false}, {"label": "B", "text": "Cutaneous anthrax generally resolves spontaneously", "correct": false}, {"label": "C", "text": "Capsular polypeptide aids in virulence by inhibiting phagocytosis", "correct": false}, {"label": "D", "text": "Toxin is a complex of two fractions", "correct": true}], "correct_answer": "D. Toxin is a complex of two fractions", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxin is a complex of two fractions The B. anthracis toxins are three toxins that work together to cause the disease. (See below)</p>\n<p><strong>Highyeild:</strong></p><p>B. anthracis has a number of virulence factors: Capsule: Under anaerobic conditions, a polypeptide capsule consisting of poly- D- glutamic acid is produced. Synthesis of the capsule is by three enzymes encoded by the capA, capB, and capC genes on the pX- 02 plasmids. A fourth protein, encoded by the dep gene, catalyses the formation of polyglutamate that inhibit phagocytosis; Toxin : Two binary toxins (o) edema factor (EF) and lethal factor (LF) bind a third toxin component protective antigen (PA) , before entering the target cell. The three toxin components are also encoded on plasmid pX- 01. LF is a zinc-dependent metallopeptidase that inhibits dendritic cell function. EF converts AMP to cyclic AMP (cAMP), resulting in the dysregulation of water and ions.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Plasmid is responsible for the toxin and capsule production. The gamma phage lysis assay is a common diagnostic method for the identification of B. anthracis and is based on the bacterium's susceptibility to lysis. Option B. Cutaneous anthrax heals on its own, but antimicrobial therapy reduces the edema and necrosis to a great extent (oral ciprofloxacin for 5 -7 days). Option C. capsule is polypeptide in nature and prevents phagocytosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The McFadyen–Stevens reaction is a chemical reaction best described as a base-catalyzed thermal decomposition of acyl sulfonyl hydrazides to aldehydes. Dudman et al. have developed an alternative hydrazide reagent. McFadyean's reaction is employed for the presumptive diagnosis of:", "options": [{"label": "A", "text": "Anthrax", "correct": true}, {"label": "B", "text": "Tetanus", "correct": false}, {"label": "C", "text": "Typhoid", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Anthrax", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anthrax The capsular material can be detected by the McFadyean reaction which involves staining with polychrome methylene blue. When a blood film containing anthrax bacilli is stained using polychrome methylene blue for a few seconds and observed under a microscope, a purplish coat of amorphous material is seen around blue-stained bacilli. The amorphous purple material is the capsule.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- So, Option B & C. These are not the correct options. Option B. The laboratory diagnosis of tetanus involves the isolation and identification of tetani and the detection of toxigenicity in the isolate by mouse toxicity testing. The latter is the definitive test for the laboratory diagnosis of tetanus. Option C. Widal blood test is both a qualitative and quantitative serological diagnostic assay for enteric fever. A Widal test report is more commonly known as the typhoid test report.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ascoli's thermoprecipitation test helps in confirming the laboratory diagnosis of:", "options": [{"label": "A", "text": "Typhoid", "correct": false}, {"label": "B", "text": "Tetanus", "correct": false}, {"label": "C", "text": "Cholera", "correct": false}, {"label": "D", "text": "Anthrax", "correct": true}], "correct_answer": "D. Anthrax", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anthrax A scoli's thermo-precipitation test : This is an antigen-antibody reaction Used for diagnosis of anthrax (Bacillus anthracis). -It is a ring precipitation test . Thermo precipitation test for the diagnosis of anthrax using a tissue extract and anthrax antiserum. Used for detection of anthrax bacilli in animal hides and meat. This method is a mixing of immunized rabbit serum with an extract of organs under examination for the production of a precipitate.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B and C. These are not correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 14 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Maternal Ab do NOT provide protective immunity to neonate against?", "options": [{"label": "A", "text": "Diphtheria", "correct": false}, {"label": "B", "text": "Pertussis", "correct": false}, {"label": "C", "text": "Tetanus", "correct": false}, {"label": "D", "text": "Polio", "correct": true}], "correct_answer": "D. Polio", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polio The poliovirus causes polio. The virus enters the body through the mouth. It is spread through contact with the feces (stool) of an infected person or through exposure to phlegm or mucus when an infected person coughs or sneezes.</p>\n<p><strong>Highyeild:</strong></p><p>Maternal antibodies protect against some diseases, such as measles, rubella, and tetanus, more effectively than others, such as polio and pertussis. Maternal passive immunity offers immediate protection, though protection mediated by maternal IgG typically only lasts up to a year. Passive immunity is provided when a person is given antibodies to a disease rather than producing them through their immune system.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The half-lives of passively acquired diphtheria, tetanus and pertussis (DTP) antibodies in infants are in months, so they are protective in the Options B & C. The half-lives of passively acquired diphtheria, tetanus and pertussis (DTP) antibodies in infants are in months, so they are protective in the Options A, B, and C. Maternal antibodies provide immunity against all these.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 16-year-old female patient presents to the emergency department with features of typical pneumonia. Since the age of 6 months, she has had recurrent episodes of pneumonia and sinusitis due to Streptococcus pneumonia and Hemophilus influenza. Which component of immune function will be abnormal?", "options": [{"label": "A", "text": "B lymphocytes", "correct": true}, {"label": "B", "text": "Macrophage", "correct": false}, {"label": "C", "text": "T lymphocytes", "correct": false}, {"label": "D", "text": "Natural killer cells", "correct": false}], "correct_answer": "A. B lymphocytes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>B lymphocytes Symptoms in question suggest a deficiency k/a common variable hypogammaglobulinemia, characterised by low serum level of IgG. Here, the number of B cells is normal, but their ability to synthesise IgG and other immunoglobulins is severely compromised. Treatment involved gamma globulins to reduce the number of infections.</p>\n<p><strong>Highyeild:</strong></p><p>Common variable immunodeficiency ( CVID ) is an immune disorder characterised by recurrent infections and low antibody levels, specifically in immunoglobulin (Ig) types IgG, IgM and IgA. [2] Symptoms generally include high susceptibility to foreign invaders, chronic lung disease, and inflammation and infection of the gastrointestinal tract. [2] CVID affects males and females equally. The condition can be found in children or teens but is generally not diagnosed or recognised until adulthood</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Defective macrophage causes recurrent infection with catalase-positive Option C. T cell deficiency results in severe viral, fungal and protozoan infections. Option D. NK cells are unlikely to present as recurrent bacterial infections because they involve cellular rather than humoral immunity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 27-year-old woman comes to the hospital with c/o fever, chills, dysuria, and back pain. The symptoms started 6 days ago with burning on urination. Her temperature is 102 F. Physical examination shows left costovertebral tenderness. Urine analysis is positive for leukocytes and nitrites, which of the following Interleukins produced by macrophage is responsible for fever production by its action on hypothalamic cells:", "options": [{"label": "A", "text": "IL 1", "correct": true}, {"label": "B", "text": "IL 2", "correct": false}, {"label": "C", "text": "IL 6", "correct": false}, {"label": "D", "text": "IL 12", "correct": false}], "correct_answer": "A. IL 1", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IL 1 Macrophages and other antigen-presenting cells produce IL 1. It is also known as endogenous pyrogen because of its direct on the hypothalamus.</p>\n<p><strong>Highyeild:</strong></p><p>IL-1 is a cytokine produced by various cells, playing a crucial role in the body's inflammatory response to infection. It promotes adhesion factors on endothelial cells, affects the hypothalamus, and causes fever, increased pain sensitivity, vasodilation, and hypotension. IL-1 family members, including IL-1α, IL-1β, IL-18, IL-33, IL-36α, IL-36β, IL-36γ, IL-36ra, IL-37, and IL-38, have diverse functions and expression patterns. They are involved in immune responses, inflammation, and regulation of energy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. IL2 produced by activated T helper cells. It stimulates the proliferation of other T cells and activated B cells. Option C. IL 6 is produced by T helper cells and macrophages and helps produce immunoglobulins and acute phase reactants. Option D. IL 12 is produced by B cells and macrophages. It activates NK cells and induces the differentiation of T helper cells into Th1 cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following best denotes classical complement pathway activation in inflammatory immune condition:", "options": [{"label": "A", "text": "C2, C4, C3 decreased", "correct": true}, {"label": "B", "text": "C2 and C4 normal, C3 is decreased", "correct": false}, {"label": "C", "text": "C3 normal and C2 C4 decreased", "correct": false}, {"label": "D", "text": "C2, C4, C3 all are elevated", "correct": false}], "correct_answer": "A. C2, C4, C3 decreased", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C2, C4, C3 decreased C2, C3 and C4 are specifically utilised in the classical pathway, hence their serum level will be low.</p>\n<p><strong>Highyeild:</strong></p><p>The classical complement pathway is one of three pathways that activate the complement system, part of the immune system. The classical complement pathway is initiated by antigen-antibody complexes with the antibody isotypes IgG and IgM. Classical pathway:- Starts by Activation of C1 by antigen antibody complex Activated C1 in turn activates C4 to C4a (anaphylotoxin) and C4b C1 4b in turn activates C2 (in presence of mg ion) to form C2a and C2b (kinin like, increases vascular permeability) C1 4b2a is known as C3 convertase which activates C5 to C5a (chemotactic and anaphylotoxin) and C3b . C14b2a3b is known as C5 convertase which activates C5 to C5a (chemotactic and anaphylotoxin) and C5b . Late components add to C5b-to form C56789 (membrane attack complex) which forms pores on cell membrane causing cell lysis and also activates bystander cells to make them susceptible to lysis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option b, c & d:Incorrect as all early complement proteins will decrease with classical pathway activation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Immunoglobulins (Ig) or antibodies are glycoproteins produced by plasma cells. B cells are instructed by specific immunogens, for example, bacterial proteins, to differentiate into plasma cells. Which of the following statements is true about an immunoglobulin?", "options": [{"label": "A", "text": "IgG has max conc. in serum", "correct": true}, {"label": "B", "text": "IgM has max conc. in serum", "correct": false}, {"label": "C", "text": "IgA has max conc. in serum", "correct": false}, {"label": "D", "text": "IgE has max conc. in serum", "correct": false}], "correct_answer": "A. IgG has max conc. in serum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IgG has max conc. in serum Decreasing order of Serum levels of various immunoglobulin is G>A>M>D>E: The highest is IgG, and the lowest is Decreasing order of Serum level of IgG subtypes: IgG1>2>3>4</p>\n<p><strong>Highyeild:</strong></p><p>IgG is the primary type of antibody found in blood and extracellular fluid, allowing it to control infection of body tissues. By binding many kinds of pathogens, such as viruses, bacteria, and fungi, IgG protects the body from infection. It does this through several mechanisms: IgG-mediated binding of pathogens causes their immobilisation and binding together via agglutination; IgG coating of pathogen surfaces (known as opsonisation) allows their recognition and ingestion by phagocytic immune cells leading to the elimination of the pathogen itself; IgG activates all the classical pathways of the complement system, a cascade of immune protein production that results in pathogen elimination; IgG also binds and neutralises toxins; IgG also plays a vital role in antibody-dependent cell-mediated cytotoxicity (ADCC) and intracellular antibody-mediated proteolysis, in which it binds to TRIM21 (the receptor with the greatest affinity to IgG in humans) to direct marked virions to the proteasome in the cytosol; IgG is also associated with type II and type III hypersensitivity reactions.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Option C. Option D.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following precipitates at 50 to 60 DEGREE C but redissolve on heating:", "options": [{"label": "A", "text": "Bence Jones proteins", "correct": true}, {"label": "B", "text": "Heavy chain", "correct": false}, {"label": "C", "text": "Both light and heavy chains", "correct": false}, {"label": "D", "text": "All of these", "correct": false}], "correct_answer": "A. Bence Jones proteins", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bence Jones proteins Abnormal immunoglobulin found in urine Coagulates at 50oC, redissolves at 70oC Elevated in Multiple myeloma Produce excess light chains</p>\n<p><strong>Highyeild:</strong></p><p>Bence Jones protein is a monoclonal globulin protein or immunoglobulin light chain found in the urine, with a molecular weight of 22–24 kDa. Detection of Bence Jones protein may suggest multiple myeloma or Waldenström's macroglobulinemia. Bence Jones proteins are particularly diagnostic of multiple myeloma in the context of target organ manifestations such as kidney failure, lytic (or \"punched out\") bone lesions, anaemia, or large numbers of plasma cells in the bone marrow of patients. Bence Jones proteins are present in 2/3 of multiple myeloma cases.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C & D. Incorrect as Bence Jones proteins usually consist of Light chains. Option B & C</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Precipitation test is an antigen-antibody reaction in which the antigen forms in a solution. It is a test in which an antibody interacts with the soluble antigen in the presence of an electrolyte to produce a precipitate. Which one is the example of a gel precipitation test?", "options": [{"label": "A", "text": "Immunoelectrophoresis", "correct": true}, {"label": "B", "text": "VDRL", "correct": false}, {"label": "C", "text": "WIDAL", "correct": false}, {"label": "D", "text": "Coomb’s test", "correct": false}], "correct_answer": "A. Immunoelectrophoresis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunoelectrophoresis Immunoelectrophoresis is a method for obtaining quicker results of immunodiffusion.</p>\n<p><strong>Highyeild:</strong></p><p>Serum immunoelectrophoresis is a lab test that measures proteins called immunoglobulins in the blood. Immunoglobulins are proteins that function as antibodies that fight infection. Many types of immunoglobulins fight different types of infections. Immunoelectrophoresis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: VDRL is a flocculation test. Option C, D: Widal and Coomb's tests are agglutination tests.</p>\n<p><strong>Extraedge:</strong></p><p>Immunoelectrophoresis is used in patients with suspected monoclonal and polyclonal gammopathies. The method is used to detect normal as well as abnormal proteins, such as myeloma proteins in human serum. Used to analyze complex protein mixtures containing different antigens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Antigen-antibody interaction, or antigen-antibody reaction, is a specific chemical interaction between antibodies pro:", "options": [{"label": "A", "text": "Idiotype", "correct": false}, {"label": "B", "text": "Genotype", "correct": false}, {"label": "C", "text": "Phenotype", "correct": false}, {"label": "D", "text": "Allotype", "correct": true}], "correct_answer": "D. Allotype", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Allotype ALLOTYPES, or allelic variants within the constant regions, are known to exist for some of these isotypes and are inherited in a Mendelian co-dominant fashion in an allelic manner(“allelic type”).</p>\n<p><strong>Highyeild:</strong></p><p>In immunology, an allotype is an immunoglobulin variation found among antibody classes and is manifested by the heterogeneity of immunoglobulins present in a single vertebrate species.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The unique amino acid sequence present in the paratope region of one member of a species acts as an antigenic determinant to other members of the same species. Such antigenic determinants are called idiotopes; the total of idiotopes on an lg molecule constitutes its idiotypes. Option B. Genotypes refers to the total of an individual’s collection of genes. Option C. Phenotype is an observable characteristic of an individual due to the interaction of genotype with the</p>\n<p><strong>Extraedge:</strong></p><p>Each antibody will only have one type of heavy chain and one type of light chain. Structural differences in the constant region of either the heavy chain or light chain within a class of antibody is referred to as the allotype of an antibody.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Synthesis of immunoglobulin in membrane-bound or secretory form is determined by:", "options": [{"label": "A", "text": "One turn to two turns joining rule", "correct": false}, {"label": "B", "text": "Class switching", "correct": false}, {"label": "C", "text": "Differential RNA processing", "correct": true}, {"label": "D", "text": "Allelic exclusion", "correct": false}], "correct_answer": "C. Differential RNA processing", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Differential RNA processing IgA is the predominant antibody in secretions whereas igE is associated with mast cell degranulation in allergic response.</p>\n<p><strong>Highyeild:</strong></p><p>Differential RNA processing of a common primary transcript determines whether the secreted or membrane form of an immunoglobulin will be produced Mature naive B-cells produce only membrane-bound antibodies (IgD or IgM), whereas differentiated plasma cells produce secreted antibodies (IgA). Membrane-bound or secreted form of immunoglobulin is synthesised by alternate RNA splicing.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. One turn to two-turn joining rule is for recombination between gene segments. Option B. Plasma cells produce a single antibody (IgM) class on antigenic stimulation. Later, gene rearrangement produces immunoglobulins of different classes with same antigen specificity (IgA or IgG). The H-chain VDJ unit can join any constant gene segment (for heavy chains) to produce antibodies of that particular class. This process is k/a Class switching. Option D. Light chain gene rearrangement takes place and following which the light chains are expressed. By allelic exclusion, only one type of light chain (either kappa or lambda) is allowed to express.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Immunoglobulin in Peyer’s patch is:", "options": [{"label": "A", "text": "IgM", "correct": false}, {"label": "B", "text": "IgG", "correct": false}, {"label": "C", "text": "IgA", "correct": true}, {"label": "D", "text": "IgD", "correct": false}], "correct_answer": "C. IgA", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IgA Peyer’s patches are composed of 30-40 lymphoid follicles present in intestinal submucosa They are required for intestinal secretory immunoglobulin A responses, which provide local or intestinal immunity or mucosal immunity.</p>\n<p><strong>Highyeild:</strong></p><p>Peyer’s patches also contain Intra epithelial CD8 lymphocytes containing TCR Ƴδ receptors.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. IgM is the first antibody to be formed after infection. Option B. IgG is the antibody of the secondary immune response. Option D. IgD and IgM are present on B cells as B cell receptors.</p>\n<p><strong>Extraedge:</strong></p><p>Immunoglobulin A IgA is the major antibody in secretions found in saliva, tears, colostrum, intestinal, genital tract, and respiratory secretions. It appears in mucosa membranes as a dimer (with a J chain when secreted) and protects the epithelial surfaces of the digestive, respiratory, and genitourinary systems.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are peripheral lymphoid organs except:", "options": [{"label": "A", "text": "LN", "correct": false}, {"label": "B", "text": "Spleen", "correct": false}, {"label": "C", "text": "MALT", "correct": false}, {"label": "D", "text": "Thymus", "correct": true}], "correct_answer": "D. Thymus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Thymus Central/ primary:- Thymus and Bursa of Fabricius (birds)/ Bone Marrow(human)</p>\n<p><strong>Highyeild:</strong></p><p>The cells of the lymph are primarily lymphocytes. Associated lymphoid organs are composed of lymphoid tissue and are the sites of lymphocyte production or lymphocyte activation. These include the lymph nodes (where the highest lymphocyte concentration is found), the spleen, the thymus, and the tonsils. Lymphocytes are initially generated in the bone marrow. The lymphoid organs also contain other types of cells, such as stromal cells, for support. [5] Lymphoid tissue is also associated with mucosas such as mucosa-associated lymphoid tissue Lymphoid Organs:-</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, C. Peripheral/ Secondary:- Spleen, Lymph Node, MALT (GIT and Respiratory mucosa).</p>\n<p><strong>Extraedge:</strong></p><p>Primary lymphoid organs: These organs include the bone marrow and the thymus. They create special immune system cells called lymphocytes. Secondary lymphoid organs: These organs include the lymph nodes, the spleen, the tonsils and certain tissue in various mucous membrane layers in the body (for instance in the bowel).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Common between B- and T-cells:", "options": [{"label": "A", "text": "Origin from same cell lineage", "correct": true}, {"label": "B", "text": "Site differentiation", "correct": false}, {"label": "C", "text": "Antigenic marker", "correct": false}, {"label": "D", "text": "Perform both humoral and cellular immunity", "correct": false}], "correct_answer": "A. Origin from same cell lineage", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Origin from same cell lineage Both T and B-cells originate from the same lymphoid progenitor cell lineage in the bone marrow.</p>\n<p><strong>Highyeild:</strong></p><p>Both B and T cells originate in the bone marrow. These cells are involved in adaptive immunity. They are a type of lymphocyte.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Side of differentiation:- T cell - in the Thymus and B cell - in the bone marrow. Option C. Antigenic markers are also different for T & B - cells. Option D. Immune response:- T cell mediates - cellular immunity, and B cell mediates - humoral immunity. Further differentiation:- T cell differentiated to TH (TH1 and TH2) and Tc cells. B cell differentiated to plasma cells.</p>\n<p><strong>Extraedge:</strong></p><p>Primary lymphoid organs: These organs include the bone marrow and the thymus. They create special immune system cells called lymphocytes. Secondary lymphoid organs: These organs include the lymph nodes, the spleen, the tonsils and certain tissue in various mucous membrane layers in the body (for instance in the bowel).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An immunologist is experimenting to understand precipitation reactions. He notes that on adding an excessive amount of antigen to a serum sample containing a small number of antibodies, the amount of precipitate formed is less. Whereas, when he added smaller amounts of antigen to the same sample, the precipitate formed more than the previous observation. What is this phenomenon called?", "options": [{"label": "A", "text": "Pro Zone phenomenon", "correct": false}, {"label": "B", "text": "Post Zone phenomenon", "correct": true}, {"label": "C", "text": "Zone of equivalence", "correct": false}, {"label": "D", "text": "Flocculation phenomenon", "correct": false}], "correct_answer": "B. Post Zone phenomenon", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Post Zone phenomenon</p>\n<p><strong>Highyeild:</strong></p><p>Postzone phenomenon is defined as a false-negative test resulting from high antigen titre, which interferes with the formation of the antigen-antibody lattice, necessary to visualise a positive test According to Lattice hypothesis The phenomenon described is called as the post zone phenomenon wherein, when excess antigen is added it leads to weak or even absent precipitation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Pro Zone phenomenon is caused by antibody excess. Option C. Zone of equivalence is when the Antigen and Antibodies Are in excess. Option D. Flocculation phenomenon is not included in the Lattice hypothesis.</p>\n<p><strong>Extraedge:</strong></p><p>Prozone - excess antibody to the available amount of antigen (no agglutination is a result) Zone of Equivalence - optimal amounts of both antibody and antigen (results in agglutination) Postzone - excess antigen to the available antibody (no agglutination is a result).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 15-year-old girl is brought to the emergency department after suffering an injury on her limbs from falling on the ground while playing with her friends. On examination, there was a large dirty wound covered with soil and bleeding. The doctor in charge decides to give the patient an injection of Tetanus immunoglobulin. Which of the following characteristics is not shown by this type of immunity?", "options": [{"label": "A", "text": "Acquired immediately", "correct": false}, {"label": "B", "text": "Memory is absent", "correct": false}, {"label": "C", "text": "Long lasting", "correct": true}, {"label": "D", "text": "No negative phase", "correct": false}], "correct_answer": "C. Long lasting", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Long lasting Giving pre-formed immunoglobulin directly is an example of acquired passive immunity which is not long-lasting.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It’s true that Immunoglobulins give immediate immunity on administration Option B. Memory is absent in acquired passive immunity Option D. Negative phase is absent in passive immunity</p>\n<p><strong>Extraedge:</strong></p><p>A type of immunity that occurs when a person is given antibodies rather than making them through his or her own immune system. For example, passive immunity occurs when a baby receives a mother's antibodies through the placenta or breast milk.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A student has a genetic defect and cannot produce the J chain, which is important in the structure of some immunoglobulin molecules. Which of the following will most likely be observed in this individual?", "options": [{"label": "A", "text": "A decrease in mature B cells", "correct": false}, {"label": "B", "text": "A decrease in mature T lymphocytes", "correct": false}, {"label": "C", "text": "A decrease in serum IgM", "correct": true}, {"label": "D", "text": "An increase in IgA in the intestine", "correct": false}], "correct_answer": "C. A decrease in serum IgM", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A decrease in serum IgM Deficiency in the production of J chains for immunoglobulins could result in a decrease in serum IgA and IgM levels. These antibodies are dimers and pentamers of the basic immunoglobulin molecule and require a J chain to join the immunoglobulin chains. There is no evidence that indicates that a deficiency in the production of J chains of IgA or IgM will cause a decrease in mature B cells, or T lymphocytes, an increase in serum IgM and a decrease in IgE, or a decrease in IgA (choices A, B, D).</p>\n<p><strong>Highyeild:</strong></p><p>The J chain regulates the multimerisation of IgM and IgA in mammals. When expressed in cells, it favours the formation of a pentameric IgM and an IgA dimer. IgM pentamers are most commonly found with a single J chain, but some studies have seen as many as 4 J chains associated with a single IgM pentamer.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. J chain does not affect the synthesis of B cells. Option D. J chain deficiency does not increase IgA. Option B. J chain do not affect the synthesis of T cells.</p>\n<p><strong>Extraedge:</strong></p><p>IgM immunoglobulins are produced by plasma cells as part of the body's adaptive humoral immune response against a foreign pathogen. Resting mature yet naive, B lymphocytes express IgM as a transmembrane antigen receptor that functions as part of the B-cell receptor (BCR).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Hapten is otherwise known as incomplete antigen Which of the following is true regarding a Hapten?", "options": [{"label": "A", "text": "It is not Immunogenic but, Antigenic", "correct": true}, {"label": "B", "text": "It is both Immunogenic and Antigenic", "correct": false}, {"label": "C", "text": "It is Immunogenic but not Antigenic", "correct": false}, {"label": "D", "text": "It is neither Immunogenic nor Antigenic", "correct": false}], "correct_answer": "A. It is not Immunogenic but, Antigenic", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It is not Immunogenic but, Antigenic Hapten is the incomplete antigen Which is Antigenic but not Immunogenic It is conjugated with a protein and induces Immunogenicity</p>\n<p><strong>Highyeild:</strong></p><p>A hapten is a substance that can combine with a specific antibody but lacks antigenicity of its own. Many small molecules of M r < 1000, such as toxins, drugs and hormones, cannot invoke an immune response when injected directly into animals. They are thus not immunogenic by themselves and are called haptens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. It is both Immunogenic and Antigenic Option C. It is Immunogenic but not Antigenic Option D. It is neither Immunogenic nor Antigenic Hapten is Antigenic but not Immunogenic</p>\n<p><strong>Extraedge:</strong></p><p>IgM immunoglobulins are produced by plasma cells as part of the body's adaptive humoral immune response against a foreign pathogen. Resting mature yet naive, B lymphocytes express IgM as a transmembrane antigen receptor that functions as part of the B-cell receptor (BCR).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A is a property of antigen Which is the ability to induce an immune response to a host (antibodies are formed against antigen). B is the property of antigen Which is the ability to bind with a specific antibody. A and B properties of an antigen are, respectively?", "options": [{"label": "A", "text": "Antigenicity and immunogenicity", "correct": false}, {"label": "B", "text": "Immunogenicity and molecular mimicry", "correct": false}, {"label": "C", "text": "Molecular mimicry and immunogenicity", "correct": false}, {"label": "D", "text": "Immunogenicity and antigenicity", "correct": true}], "correct_answer": "D. Immunogenicity and antigenicity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunogenicity and antigenicity</p>\n<p><strong>Highyeild:</strong></p><p>The term immunogenicity refers to the ability of a substance to induce a cellular and humoral immune response, while antigenicity is the ability to be specifically recognised by the antibodies generated as a result of the immune response to the given substance. Ability to induce an immune response to the host is known as Immunogenicity Ability to bind specific antibodies is known as Antigenicity</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Antigenicity and Immunogenicity Option B. Immunogenicity and molecular mimicry Structural similarity between different antigens is known as molecular mimicry. Molecular mimicry can be shared by the infective organism antigen and human self-antigen, Which results in complications due to antibodies against causative organisms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not true regarding T cell-independent antigen?", "options": [{"label": "A", "text": "Antigen directly activates B Cell, which results in polyclonal activation", "correct": false}, {"label": "B", "text": "Antigen-presenting cell processes the antigen and presents the Antigenic peptides molecules on its surface to T helper cells", "correct": true}, {"label": "C", "text": "Polyclonal activation of B Cells results in the production of antibodies and exaggerated immune response", "correct": false}, {"label": "D", "text": "All the above statements are true regarding a T Cell independent antigen", "correct": false}], "correct_answer": "B. Antigen-presenting cell processes the antigen and presents the Antigenic peptides molecules on its surface to T helper cells", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigen-presenting cell processes the antigen and presents the Antigenic peptides molecules on its surface to T helper cells</p>\n<p><strong>Highyeild:</strong></p><p>T independent antigen elicits antibody production by B lymphocytes without T lymphocyte There are 2 distinct subgroups of TI antigens, different in the mechanism of activating B lymphocytes. TI-1 antigen has an activity that can directly activate B cells and TI-2 antigen , has a highly repetitive structure and causes simultaneous cross-linking of specific B cell receptors (BCR) on B lymphocytes. The most commonly released isotype of antibodies in this type of immune reaction is low affinity IgM T Cell independent antigens doesn't have any role in in a activation of T Cells via antigen-presenting cell. T Cell dependent antigen has a role in getting process to by an antigen-presenting cell and is presented to T Cell Which further activates B Cell for production of antibodies normal immune response T Cell independent antigen directly activate B Cells and results in polyclonal activation antibody production and exaggerated immune response</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Antigen directly activates B Cell Which results in polyclonal activation T Cell independent antigen directly activate B Cells and results in polyclonal activation antibody production and exaggerated immune response Option C. Polyclonal activation of B Cells results in production of antibodies and exaggerated immune response T Cell independent antigen directly activate B Cells and results in polyclonal activation antibody production and exaggerated immune response Option D. All the above statements are true regarding a T Cell independent antigen</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "When two organisms share the same antigen, the same antibody can bind to both antigens. The antigen in this immunological mechanism is known as:", "options": [{"label": "A", "text": "T Cell dependent antigen", "correct": false}, {"label": "B", "text": "T Cell independent antigen", "correct": false}, {"label": "C", "text": "Super antigen", "correct": false}, {"label": "D", "text": "Heterophile antigen", "correct": true}], "correct_answer": "D. Heterophile antigen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Heterophile antigen Heterophile antigen is an antigen shared by two different organisms Which therefore results in binding to the same antibody This immunological mechanism is the basis of heterophile agglutination tests like Paul Bunnell test /Weil Felix reaction etc.</p>\n<p><strong>Highyeild:</strong></p><p>Heterophile antigens are antigens of similar nature, if not identical, that are present in different tissues in different biological species, classes, or kingdoms. [1] Usually, different species have different antigen sets, but the hetereophile antigen is shared by different species. Other heterophile antigens are responsible for some diagnostic serological tests such as: Weil-Felix reaction for typhus fever Paul Bunnell test for infectious mononucleosis Cold agglutinin test in primary atypical pneumonia</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. T cell-dependent antigen T cell-dependent antigen has a role in getting the process to by an antigen-presenting cell and is presented to T Cell Which further activates B Cell for production of antibodies normal immune response. Option B. T Cell independent antigen T Cell independent antigen directly activate B Cells and results in polyclonal activation antibody production and exaggerated immune response. Option C. Super antigen Super antigen is produced by various microorganisms, which directly activates the T Cell receptors by binding to the v beta domain and polyclonal activation of B Cells, resulting in exaggerated immune response.</p>\n<p><strong>Extraedge:</strong></p><p>Heterophile antibodies are antibodies produced against poorly defined antigens. These are generally weak antibodies with multispecific activities. Human anti-animal antibodies that develop as a result of treatments with animal immunoglobulins are antibodies with strong avidities, produced against well-defined antigens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old man presented to the outpatient clinic with complaints of fever, cold, cough, myalgia, headache since 5 days. The attending physician advised antibody testing. Antibody-secreting plasma cells are derived from?", "options": [{"label": "A", "text": "T Cells", "correct": false}, {"label": "B", "text": "B Cells", "correct": true}, {"label": "C", "text": "Macrophages", "correct": false}, {"label": "D", "text": "Neutrophils", "correct": false}], "correct_answer": "B. B Cells", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>B Cells Plasma cells are derived from terminally differentiated B Cells, which have an important role in antibody secretion.</p>\n<p><strong>Highyeild:</strong></p><p>A type of immune cell that makes large amounts of a specific antibody. Plasma cells develop from B cells that have been activated. A plasma cell is a type of white blood cell. Also called a plasmacyte.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- IgA Dimer Option A. T Cells T Cell has a role in recognising processed antigens by antigen-presenting Option C. Macrophages Macrophages are derived from monocytes and have a role in chronic inflammation and type 4 hypersensitivity. Option D. Neutrophils Neutrophils can function as antigen-presenting cells and play an essential role in acute inflammation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old male presented with fever, cough, cold, chills and shortness of breath. The condition of the patient is caused by streptococcus pneumoniae. Pneumococcal is a capsulated bacterium that has c carbohydrate antigen in it, which is a T Cell independent antigen. All the following are true regarding c carbohydrate antigen except?", "options": [{"label": "A", "text": "It has lower Immunogenicity than protein antigen", "correct": false}, {"label": "B", "text": "It can cause polyclonal B Cell Activation", "correct": false}, {"label": "C", "text": "Does not require stimulation by T Cells", "correct": false}, {"label": "D", "text": "Memory response is present", "correct": true}], "correct_answer": "D. Memory response is present", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Memory response is present T Cell independent antigen directly activates B Cells and results in polyclonal activation antibody production and exaggerated immune response. Since they do not require T Cell activation, that does not have any memory.</p>\n<p><strong>Highyeild:</strong></p><p>Group A carbohydrate (GAC) is a bacterial peptidoglycan-anchored surface rhamnose polysaccharide (RhaPS) that is essential for the growth of Streptococcus pyogenes and contributes to its ability to infect the human host.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It has lower Immunogenicity than protein antigens. Option B. It can cause polyclonal B Cell activation. Option C. Does not require stimulation by T Cells. T Cell independent antigen directly activates B Cells and produces polyclonal activation antibody production and exaggerated immune response.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 43-year-old male inmate with stage C3 HIV/AIDS presents with loose, watery stools, abdominal cramping, sweats, fevers, poor appetite (2 months) and 15 lbs. weight loss. He is taking Tenofovir one tablet bid and Nelfinavir 1,000 mg tid, and trimethoprim/sulfamethoxazole for secondary pneumocystis carinii pneumonia (PCP) prophylaxis. He reports good adherence, with an undetectable viral load and a CD4 count of 100 cells/mm3. All the following are the functions of CD4 cells except?", "options": [{"label": "A", "text": "They play an important role in Immunogenic memory", "correct": false}, {"label": "B", "text": "Activation of macrophages", "correct": false}, {"label": "C", "text": "Activation of cytotoxic T Cells", "correct": false}, {"label": "D", "text": "Production of immunoglobulins", "correct": true}], "correct_answer": "D. Production of immunoglobulins", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Production of immunoglobulins Immunoglobulin production is the function of plasma cells Which are derived from differentiated B Cells</p>\n<p><strong>Highyeild:</strong></p><p>The CD4+T cells carry out multiple functions, ranging from activation of the cells of the innate immune system, B-lymphocytes, cytotoxic T cells, as well as nonimmune cells, and also play a critical role in the suppression of immune reaction.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. They play an essential role in Immunogenic memory. Helper T Cells play an important role in the recognition of T Cell dependent antigens and also Immunogenic memory. Option B. Activation of macrophages T helper cells play an essential role in the activation of macrophages and granuloma formation in in granulomatous inflammation. Option C. Activation of cytotoxic T Cells</p>\n<p><strong>Extraedge:</strong></p><p>CD8-positive T cells are a critical subpopulation of MHC class I-restricted T cell and are mediators of adaptive immunity. They include cytotoxic T cells, which are important for killing cancerous or virally infected cells, and CD8-positive suppressor T cells, which restrain certain types of immune response.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 24-year-old male presented with a sore throat, headache, fever, and shortness of breath. Many immunological mechanisms are associated with pathogenic mechanisms of an infection in the patient. complement proteins are plasma mediators responsible for immunological mechanisms. Which of the following is required for activation of the classical complement pathway?", "options": [{"label": "A", "text": "Antigen-antibody complex", "correct": true}, {"label": "B", "text": "C3", "correct": false}, {"label": "C", "text": "Membrane binding lectin", "correct": false}, {"label": "D", "text": "Antigen", "correct": false}], "correct_answer": "A. Antigen-antibody complex", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigen-antibody complex Antigen-antibody complex and endotoxins are the triggers for activation of the classical complement pathway.</p>\n<p><strong>Highyeild:</strong></p><p>The classical pathway is usually triggered by antigen–antibody complexes that bind the C1 complex (C1q, C1r, C1s) through the C1q component. This activates C1s, which is then able to cleave the C4 complement protein into C4a and C4b. C4b attaches to its target surface via its exposed metastable thioester binding site.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. C3 is activated in an alternate complement pathway due to exposure to antigen Option C. Inductor in complement pathway C4 started initially Option D. The typical way is the formation of membrane attack complex MAC. So, Options B, C, and D differ from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Complement is a system of plasma proteins that can be activated directly by pathogens or indirectly by pathogen-bound antibody, leading to a cascade of reactions that occurs on the surface of pathogens and generates active components with various effector functions.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The test shown in the Image below is a type of which of the following?", "options": [{"label": "A", "text": "Indirect hemagglutination test.", "correct": false}, {"label": "B", "text": "Slide flocculation test.", "correct": true}, {"label": "C", "text": "Gel precipitation test.", "correct": false}, {"label": "D", "text": "None of the above.", "correct": false}], "correct_answer": "B. Slide flocculation test.", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245041095-QTDV042002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Slide flocculation test. A Flocculation Test Procedure determines how much Flocculants need to be added to solids in suspension slurry or pulp to cause the individual particles to collect as flocs. The formation of flocs aids in improved settling rates, better overhead clarity, and faster filtration rates.</p>\n<p><strong>Highyeild:</strong></p><p>Medical Definition of flocculation test: any of various serological tests (such as the Mazzini test for syphilis) in which a positive result depends on combining an antigen and antibody to produce a fluffy precipitate.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. An indirect hemagglutination (IHA) test using sonicated extract as the antigen was developed to detect antibodies to Clostridium chauvoei. This antigen can be adsorbed onto glutaraldehyde-fixed sheep red blood cells treated with tannic acid and can be destroyed by trypsin and heat treatment. Option C. The agar gel precipitation (AGP) test has been applied to various avian diseases to detect precipitating antibodies. Malkinson (1974) used the test to study the serological response of geese to goose parvovirus.</p>\n<p><strong>Extraedge:</strong></p><p>Slide test: In this test a drop of each of the antigen and the antiserum are added on a slide, then both antigen and antiserum are mixed by shaking. The reaction observed in the form of floccules formation. The VDRL test for syphilis is one of the examples of slide flocculation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Activator of alternative complement pathway is?", "options": [{"label": "A", "text": "Antigen-Antibody complex", "correct": false}, {"label": "B", "text": "Mannose-binding lectin", "correct": false}, {"label": "C", "text": "Bacterial surface polysaccharide", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Bacterial surface polysaccharide", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacterial surface polysaccharide The complement system's alternative pathway is an innate component of the immune system's natural defense against infections.</p>\n<p><strong>Highyeild:</strong></p><p>The alternative pathway is one of three complement pathways that opsonize and kill pathogens. The pathway is triggered when the C3b protein directly binds a microbe. The alternative pathway is one of three complement pathways that opsonize and kill pathogens. This pathway is activated by viruses, fungi, bacteria, parasites, cobra venom, immunoglobulin A, and polysaccharides and forms an integral part of the defense mechanism independent of the immune response.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. is for activation of the classical pathway of the complement system. Option B. Mannose-binding lectin plays an essential role in the body’s immune response by attaching to foreign invaders such as bacteria, viruses, or yeast and turning on (activating) the complement system</p>\n<p><strong>Extraedge:</strong></p><p>There are three pathways of complement activation: the classical pathway, which is triggered directly by pathogen or indirectly by antibody binding to the pathogen surface; the MB-lectin pathway; and the alternative pathway, which also provides an amplification loop for the other two pathways.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The classic complement pathway is initiated by the interaction of C1 with?", "options": [{"label": "A", "text": "Antigen.", "correct": false}, {"label": "B", "text": "Factor B.", "correct": false}, {"label": "C", "text": "Antigen-IgG complexes.", "correct": true}, {"label": "D", "text": "Bacterial lipopolysaccharides.", "correct": false}], "correct_answer": "C. Antigen-IgG complexes.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigen-IgG complexes.</p>\n<p><strong>Highyeild:</strong></p><p>The classical complement pathway typically requires antigen—antibody complexes (immune complexes) for activation (specific immune response). In contrast, C3 hydrolysis, foreign material, pathogens, or damaged cells can activate the alternative route.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The classical complement pathway is one of three pathways that activate the complement system, part of the immune system. Options A, B, and C. The classical complement pathway is initiated by antigen-antibody complexes with the antibody isotypes IgG and IgM. The classical complement pathway is activated upon binding of the C1 complex, consisting of the recognition molecule C1q and the tetrameric protease complex C1r2s2, to a variety of activators presenting specific molecular patterns such as IgG- and IgM- containing immune complexes. Options A, B, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>There are three pathways of complement activation: the classical pathway, which is triggered directly by pathogen or indirectly by antibody binding to the pathogen surface; the MB-lectin pathway; and the alternative pathway, which also provides an amplification loop for the other two pathways.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cleavage of which component is seen in both classical and alternative complement pathway:", "options": [{"label": "A", "text": "C1", "correct": false}, {"label": "B", "text": "C2", "correct": false}, {"label": "C", "text": "C3", "correct": true}, {"label": "D", "text": "C4", "correct": false}], "correct_answer": "C. C3", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C3 The alternative and classical pathway C3 convertases cleave C3 to yield components C3a and C3b. The cleavage occurs in C3; Arg77 becomes the essential C-terminal residue of the bioactive polypeptide, C3a. C3 convertase can refer to the form produced in the alternative pathway (C3bBb) or the classical and lectin pathways (C4bC2b, formerly C4b2a).</p>\n<p><strong>Highyeild:</strong></p><p>The main difference between classical and alternative pathways is that the initiation of alternative pathways is not dependent on the presence of immune complexes. The lectin pathway is activated following the recognition and binding of pathogen-associated molecular patterns (PAMPs) by mannose-binding lectin (MBL) [27]</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. Are different from the correct answers to this question.</p>\n<p><strong>Extraedge:</strong></p><p>There are three pathways of complement activation: the classical pathway, which is triggered directly by pathogen or indirectly by antibody binding to the pathogen surface; the MB-lectin pathway; and the alternative pathway, which also provides an amplification loop for the other two pathways.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "MHC CLASS I MOLECULE is composed of:", "options": [{"label": "A", "text": "A polymorphic beta-globulin chain and a conserved alpha chain", "correct": false}, {"label": "B", "text": "A conserved beta-globulin chain and a polymorphic alpha chain", "correct": true}, {"label": "C", "text": "A polymorphic gamma chain and a conserved alpha chain", "correct": false}, {"label": "D", "text": "A polymorphic alpha chain and a polymorphic beta chain", "correct": false}], "correct_answer": "B. A conserved beta-globulin chain and a polymorphic alpha chain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A conserved beta-globulin chain and a polymorphic alpha chain</p>\n<p><strong>Highyeild:</strong></p><p>The major histocompatibility (MHC) class I antigen presentation pathway is vital in alerting the immune system to virally infected cells. MHC class I molecules are expressed on the cell surface of all nucleated cells and present peptide fragments derived from intracellular proteins. MHC class I molecules are one of two primary classes of major histocompatibility complex molecules. They are found on the cell surface of all nucleated cells in the bodies of vertebrates. They also occur on platelets but not on red blood cells. The major histocompatibility (MHC) class I antigen presentation pathway is vital in alerting the immune system to virally infected cells. MHC class I molecules are expressed on the cell surface of all nucleated cells and present peptide fragments derived from intracellular proteins. MHC class I molecules are heterodimers that consist of two polypeptide chains, α and β2- microglobulin (B2M). The two chains are linked non-covalently via the interaction of B2M and the α3 domain. The α1 and α2 domains fold to make up a groove for binding peptides. Options A, C, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>The major histocompatibility complex (MHC) is a group of genes that encode proteins on the cell surface that have an important role in immune response. Their main role is in antigen presentation where MHC molecules display peptide fragments for recognition by appropriate T-cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A microbiologist performing single diffusion in One dimension gel precipitation as shown in the image below. Following is the method used:", "options": [{"label": "A", "text": "Oudin procedure", "correct": true}, {"label": "B", "text": "Oakley-Fulthorpe procedure", "correct": false}, {"label": "C", "text": "Radial Immunodiffusion", "correct": false}, {"label": "D", "text": "Ouchterlony procedure", "correct": false}], "correct_answer": "A. Oudin procedure", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245049423-QTDV042008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oudin procedure The gel precipitation method is an immunodiffusion method of antigen-antibody reactions. The Oudin procedure is an immunodiffusion method in single diffusion in One dimension.</p>\n<p><strong>Highyeild:</strong></p><p>Single diffusion in one dimension: In this method, the antibody is incorporated into agar gel in a test tube, and the antigen solution is poured over it. Over time, the antibody in agar gel and a line of precipitation is formed.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Oakley-Fulthorpe procedure Oakley-Fulthorpe procedure is an immunodiffusion method that occurs in double diffusion in One dimension. Option C. Radial Immunodiffusion Radial Immunodiffusion is an immunodiffusion method that occurs in single diffusion in two dimensions. Option D. The ouchterlony procedure is an immunodiffusion method that occurs in double diffusion in two dimensions.</p>\n<p><strong>Extraedge:</strong></p><p>The commonly known types are: Single diffusion in one dimension (Oudin procedure) Double diffusion in one dimension (Oakley Fulthorpe procedure) Single diffusion in two dimensions (radial immunodiffusion or Mancini method) Double diffusion in two dimensions (Ouchterlony double immunodiffusion)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A microbiologist performing single diffusion in two-dimension gel precipitation is shown in the image below. Following is the method used:", "options": [{"label": "A", "text": "Oudin procedure", "correct": false}, {"label": "B", "text": "Oakley-Fulthorpe procedure", "correct": false}, {"label": "C", "text": "Radial Immunodiffusion", "correct": true}, {"label": "D", "text": "Ouchterlony procedure", "correct": false}], "correct_answer": "C. Radial Immunodiffusion", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245051080-QTDV042009IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Radial Immunodiffusion Radial Immunodiffusion. Radial Immunodiffusion is an immunodiffusion method that occurs in single diffusion in two dimensions.</p>\n<p><strong>Highyeild:</strong></p><p>What is the radial immunodiffusion technique? Radial Immunodiffusion (RID) RID is an older method based on the classic precipitin reaction in which antigen and antibodies react to form precipitates in liquid or semi-fluid media. Under conditions of antibody excess, the quantity of the precipitate isacc directly related to the quantity of antigen in the test sample.</p>\n<p><strong>Extraedge:</strong></p><p>The commonly known types are: Single diffusion in one dimension (Oudin procedure) Double diffusion in one dimension (Oakley Fulthorpe procedure) Single diffusion in two dimensions (radial immunodiffusion or Mancini method) Double diffusion in two dimensions (Ouchterlony double immunodiffusion)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A microbiologist performing double diffusion in One dimension type of gel precipitation as shown in the below image. Following is the method used:", "options": [{"label": "A", "text": "Oudin procedure", "correct": false}, {"label": "B", "text": "Oakley-future procedure", "correct": true}, {"label": "C", "text": "Radial Immunodiffusion", "correct": false}, {"label": "D", "text": "Oucherlany procedure", "correct": false}], "correct_answer": "B. Oakley-future procedure", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245051444-QTDV042010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oakley-future procedure Oakley-future procedure an immunodiffusion method that occurs in double diffusion in One dimension.</p>\n<p><strong>Highyeild:</strong></p><p>Oudin immunodiffusion Simple immunodiffusion (Oudin technique) in which one of the two reagents remains fixed (either the antigen or the antibody) and the other reagent moves. Double immunodiffusion (Ouchterlony technique) in which antigen and antibody are free to move towards each other.</p>\n<p><strong>Extraedge:</strong></p><p>The commonly known types are: Single diffusion in one dimension (Oudin procedure) Double diffusion in one dimension (Oakley Fulthorpe procedure) Single diffusion in two dimensions (radial immunodiffusion or Mancini method) Double diffusion in two dimensions (Ouchterlony double immunodiffusion)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 18-year-old pregnant woman came to the clinic with a low-grade fever, malaise, and headache. She was sent to home with a diagnosis of influenza. She again sought treatment seven days later with a macular rash on her trunk, arms, hands, and feet. Further questioning of the patient when serology results were known revealed that one month previously, she had a painless ulcer on her vagina that healed spontaneously. VDRL Venereal disease research laboratory test was performed. Which of the following antigen-antibody reaction is the basis of the above investigation? An 18-year-old pregnant woman came to the clinic with a low-grade fever, malaise, and headache. She was sent home with a diagnosis of influenza. She again sought treatment seven days later with a macular rash on her trunk, arms, hands, and feet. Further questioning of the patient when serology results were known revealed that one month previously, she had a painless ulcer on her vagina that healed spontaneously. VDRL test was performed. Which of the following antigen-antibody reaction is the basis of the above investigation?", "options": [{"label": "A", "text": "Tube flocculation", "correct": false}, {"label": "B", "text": "Slide flocculation", "correct": true}, {"label": "C", "text": "Agglutination", "correct": false}, {"label": "D", "text": "Neutralization", "correct": false}], "correct_answer": "B. Slide flocculation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Slide flocculation VDRL test is an example of a precipitation test where floating precipitins are formed by soluble antigens and specific antibodies performed on a slide using patients’ samples. VDRL test is specific for Treponema pallidum</p>\n<p><strong>Highyeild:</strong></p><p>The most common procedures are serologic tests for syphilis, or STS carried out on a sample of blood serum. The STS is based on their ability to detect syphilis reagin (an antibody-like substance) by initiating its reaction with an antigen to produce visible clumping, or flocculation, within the serum.</p>\n<p><strong>Extraedge:</strong></p><p>Slide test: In this test a drop of each of the antigen and the antiserum are added on a slide, then both antigen and antiserum are mixed by shaking. The reaction observed in the form of floccules formation. The VDRL test for syphilis is one of the examples of slide flocculation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 29-year-old woman who works as a research assistant in a veterinary microbiology laboratory complained of intermittent fever, anorexia, profuse sweating, malaise, headache, and muscle pain especially of the neck and shoulder, and arthralgia for three days. Their blood pressure was recorded as 110/80. She was one of the nine laboratory workers who were involved in research on the isolation of B. melitensis from goats for the past three months. The next day, she was admitted to a clinic for blood tests. Which of the following test is performed in the patient suspecting brucellosis?", "options": [{"label": "A", "text": "Standard agglutination test", "correct": true}, {"label": "B", "text": "Widal test", "correct": false}, {"label": "C", "text": "Microscopic agglutination test", "correct": false}, {"label": "D", "text": "Cold agglutination test", "correct": false}], "correct_answer": "A. Standard agglutination test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Standard agglutination test Standard agglutination test is an example of agglutination type of antigen-antibody reaction which is commonly used for diagnosis of brucellosis</p>\n<p><strong>Highyeild:</strong></p><p>The smooth, attenuated stained antigen suspensions are mixed with the patient's serum. Specific antibodies to Brucella antigens, if present in the patient's serum, will react with the antigen suspension to produce an agglutination reaction.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. widal test Widal test is an example of an agglutination type of antigen-antibody reaction useful for lab diagnosis of salmonella /typhoid fever</p>\n<p><strong>Extraedge:</strong></p><p>Slide test: In this test a drop of each of the antigen and the antiserum are added on a slide, then both antigen and antiserum are mixed by shaking. The reaction observed in the form of floccules formation. The VDRL test for syphilis is one of the examples of slide flocculation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following antigen-antibody reaction is the basis for the following investigation shown in the image below?", "options": [{"label": "A", "text": "Precipitation", "correct": false}, {"label": "B", "text": "Neutralization", "correct": false}, {"label": "C", "text": "Flocculation", "correct": false}, {"label": "D", "text": "Agglutination", "correct": true}], "correct_answer": "D. Agglutination", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245054541-QTDV042014IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Agglutination The given image is predicted to be a widal valuable test for the diagnosis of typhoid fever. Agglutination is the antibody-antigen reaction basis for widal test.</p>\n<p><strong>Highyeild:</strong></p><p>The purpose of agglutination is to detect the presence of specific antigens or antibodies in samples of bodily fluids, such as blood, saliva, urine, or cerebrospinal fluid (CSF); as well as to identify specific strains of bacteria in microbiological cultures.</p>\n<p><strong>Extraedge:</strong></p><p>Slide test: In this test a drop of each of the antigen and the antiserum are added on a slide, then both antigen and antiserum are mixed by shaking. The reaction observed in the form of floccules formation. The VDRL test for syphilis is one of the examples of slide flocculation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The patient was a 65-year-old blind man living in the countryside. the patient mainly lived alone in the past three months due to his wife’s death. He had a history of keeping animals, including some sheep and goats, at home. He had a long history of COPD. But his symptoms had started a week ago. The symptoms had not improved despite antibiotic treatment; therefore, the patient was referred to us at the medical center of the province. He is characterized by mild fever, dyspnea, non-bloody sputum with pus, anorexia, and myalgia. In the preliminary examination, he had a blood pressure of 120/80 mmHg, a respiratory rate of 24 per minute, a pulse rate of 90 beats per minute, and a temperature of 37.6 °C. In physical examination, he had a skin rash on his face and extremities, and also, no symptoms of icterus were observed. Radiological evidence shows evidence of hemorrhagic mediastinitis. Which of the following immunological test is useful for laboratory detection of causative organism?", "options": [{"label": "A", "text": "Ascoli thermo precipitation", "correct": true}, {"label": "B", "text": "Elks gel precipitation", "correct": false}, {"label": "C", "text": "Paul Bunnell test", "correct": false}, {"label": "D", "text": "Latex agglutination", "correct": false}], "correct_answer": "A. Ascoli thermo precipitation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ascoli thermo precipitation The given clinical history is suggestive of pulmonary anthrax Hemorrhagic mediastinitis is the classic finding associated with pulmonary Anthrax Ascoli thermo precipitation test is specific Anthrax detection in laboratory</p>\n<p><strong>Highyeild:</strong></p><p>What is Ascoli thermo precipitation test? This test is used for the diagnosis of Anthrax. In advanced decomposition of carcass and when the microscopical examination is almost impossible, the precipitation method of Ascoli is used for diagnosis of Anthrax</p>\n<p><strong>Extraedge:</strong></p><p>Precipitation refers to the creation of clearly visible insoluble lattices or cross-linkages, whereas agglutination refers to the formation of huge solid clumps as a result of antibody-antigen interaction.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The antigen antibody reaction depicted in the image below is suggestive of:", "options": [{"label": "A", "text": "Naeglers reaction", "correct": true}, {"label": "B", "text": "Heterophile agglutination reaction", "correct": false}, {"label": "C", "text": "Ascoli thermo precipitation test", "correct": false}, {"label": "D", "text": "Slide flocculation assay", "correct": false}], "correct_answer": "A. Naeglers reaction", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245056950-QTDV042016IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Naeglers reaction Naeglers reaction is a neutralization reaction to demonstrate Alpha toxin clostridium perfringens</p>\n<p><strong>Highyeild:</strong></p><p>What is the positive reaction in the Nagler test? The alpha toxin of C. perfringens has phospholipase activity and hence when grown on a medium containing egg yolk phospholipid, the organism can break down this insoluble triglyceride. Phosphoryl choline release is seen as an area of opacity around the bacterial colonies. This is described as being Nagler positive</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: B. Heterophile agglutination reaction Heterophile agglutination reaction is basis on molecular mimicry mechanism Examples include Weil Felix test/Paul Bunnell test/cold agglutination test/streptococcal MG test Option: C. Ascoli thermo precipitation test Ascoli thermo precipitation test is useful for demonstration of bacillus anthracis Option: D. Slide flocculation assay Slide flocculation test is the basis for VDRL test which is useful for diagnosis of treponema pallidum</p>\n<p><strong>Extraedge:</strong></p><p>Perfringens will primarily cause watery diarrhea. Other symptoms may include nausea, vomiting, abdominal pain, and fever. 8-12 hours, but can take up to 24 hours from ingestion. Duration of symptoms is typically less than 24 hours.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The antigen-antibody reaction depicted in the below image:", "options": [{"label": "A", "text": "Naegler's reaction", "correct": false}, {"label": "B", "text": "Ascoli thermo precipitation test", "correct": false}, {"label": "C", "text": "Elks gel precipitation test", "correct": true}, {"label": "D", "text": "Heterophile agglutination reaction", "correct": false}], "correct_answer": "C. Elks gel precipitation test", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245057793-QTDV042017IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Elks gel precipitation test Elks gel precipitation test is an applied precipitation technique that is useful the for detection of clostridium Diphtheria.</p>\n<p><strong>Highyeild:</strong></p><p>Elek gel ppt test Elek's test or the Elek plate test is an in vitro test of virulence performed on specimens of Corynebacterium diphtheriae, the bacteria that causes diphtheria. It is used to test for the toxigenicity of C. diphtheriae strains.</p>\n<p><strong>Extraedge:</strong></p><p>A standard microbiological method for identifying Clostridium perfringens in which bacteria are cultured on agar containing egg yolk; an opalescent halo is formed around colonies that produce lecithinase (clostridial α-toxin)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old boy, who was otherwise previously healthy, was admitted to our hospital after suffering for six days from a dry cough with a fever up to 38.8°C. Prior to admission to our hospital, blood samples were analyzed on three different days at another hospital, revealing normal WBC counts and increasing CRP (12, 22, 45 mg/L; NR < 8 mg/L), ESR 28 mm/60 min. His breath sounds were normal, and no abnormal physical findings were observed. The chest radiograph showed pneumonic consolidation on the right upper lung field. Thus, he was diagnosed with atypical pneumonia. After taking a pharyngeal swab sample and serum, he was initially treated with intravenous azithromycin 10 mg/kg/d for 5 days based on the pediatrician's empirical judgment. After 3 days in our hospital, his temperature was falling, and his cough subsided. After 5 days of antibiotic therapy here, no relapse (fever and cough) was observed, and his chest radiograph also showed improvement. Which of the following immunological tests is useful for the detection of mycoplasma?", "options": [{"label": "A", "text": "Weil Felix reaction", "correct": false}, {"label": "B", "text": "Standard agglutination test", "correct": false}, {"label": "C", "text": "Cold agglutination test", "correct": true}, {"label": "D", "text": "Microscopic agglutination test", "correct": false}], "correct_answer": "C. Cold agglutination test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cold agglutination test Cold agglutination test is a heterophile agglutination test useful fother detection of mycoplasma.</p>\n<p><strong>Highyeild:</strong></p><p>What is a cold agglutination test? A cold agglutinins blood test is done to check for conditions that cause the body to make certain types of antibodies called cold agglutinins. Cold agglutinins are normally made by the immune system in response to infection. They cause red blood cells to clump together (agglutinate) at low temperatures.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: A) Weil Felix reaction. Weil Felix reaction be a heterophile agglutination test useful for detection of rickettsia species using proteus antigens. Disease Weil-Felix OX-19 Ox-2 OX-K Rocky Mountain spotted fever + + + Rickettsial pax - - - Epidemic typhus + - - Endemic typhus + - - Brill-Zinsser disease +|- - - Scrub typhus - - + Trench fever - - - - - - Option: B. Standard agglutination test. Standard agglutination test is useful for detection of brucellosis. Option: D. Microscopic agglutination test. Microscopic agglutination test is useful for detection of leptospirosis.</p>\n<p><strong>Extraedge:</strong></p><p>A cold agglutinins blood test is done to check for conditions that cause the body to make certain types of antibodies called cold agglutinins. Cold agglutinins are normally made by the immune system in response to infection. They cause red blood cells to clump together (agglutinate) at low temperatures.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following laboratory procedure is depicted in the given image below:", "options": [{"label": "A", "text": "Direct ELISA", "correct": false}, {"label": "B", "text": "Indirect ELISA", "correct": false}, {"label": "C", "text": "Sandwich ELISA", "correct": true}, {"label": "D", "text": "Chemiluminescence immunoassay (CLIA)", "correct": false}], "correct_answer": "C. Sandwich ELISA", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245059267-QTDV042020IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sandwich ELISA In sandwich Elisa we detect the desired antigen by binding to the coated antibody a on plate. Enzyme coated antibody bind to the antigen in the sample. Antigen sandwich between two antibodies can be seen.</p>\n<p><strong>Highyeild:</strong></p><p>Sandwich ELISA test A sandwich ELISA measures antigen between two layers of antibodies (capture and detection antibody). The target antigen must contain at least two antigenic sites capable of binding to antibodies. Monoclonal or polyclonal antibodies can be used as the capture and detection antibodies in sandwich ELISA systems.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. direct ELISA In direct Elisa we detect antigens in which antigen in the sample will bind to enzyme coated antibody which can be detected after washing Option B. Indirect ELISA In indirect Elisa we detect antibody in which sample containing antibody will bind to enzyme coated anti- antibody which can be detected after washing the plate Option D. Chemiluminescence immunoassay (CLIA) In chemiluminescence immunoassay, an uncoated slide with a smear sample containing antigen is subjected to a chemiluminescence component which reacts with the substrate and becomes chromogenic under the light</p>\n<p><strong>Extraedge:</strong></p><p>Enzyme-linked immunosorbent assay (ELISA) is a heterogeneous EIA technique used in clinical analyses.[1] In this type of assay, one of the reaction components is nonspecifically adsorbed or covalently bound to the surface of a solid phase, such as a microtiter well, a magnetic particle, or a plastic bead.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following immunological assay method was used in the given image below to detect the infectious agent?", "options": [{"label": "A", "text": "Enzyme-linked immunosorbent assay", "correct": false}, {"label": "B", "text": "Immunofluorescence assay", "correct": true}, {"label": "C", "text": "Vertical flow assay", "correct": false}, {"label": "D", "text": "Chemiluminescent immunological assay (CLIA)", "correct": false}], "correct_answer": "B. Immunofluorescence assay", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245059643-QTDV042021IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunofluorescence assay Immunofluorescence essay can be direct or indirect methods useful to diagnose various infections by detecting an antigen or antibody respectively. This method uses a fluorescent dye & a fluorescent microscope which can be helpful in the analysis of results</p>\n<p><strong>Highyeild:</strong></p><p>Immunofluorescence assay (IFA) is a standard virologic technique to identify the presence of antibodies by their specific ability to react with viral antigens expressed in infected cells; bound antibodies are visualized by incubation with fluorescently labeled antihuman antibody.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Enzyme-linked immunosorbent assay Enzyme-linked immunosorbent assay is useful for detection of antigen or antibody using an enzyme which is useful to convert a substrate which is helpful for analysis. Option: C. vertical flow assay. Vertical flow assay is a card test which has a control and test. -->control is positive and the test can be positive or negative according to the underlying condition. Option: D. Chemiluminescent immunological assay (CLIA). In chemiluminescence immunoassay, an uncoated slide with a smear sample containing antigen is subjected to a chemiluminescence component which reacts with the substrate and becomes chromogenic under the light.</p>\n<p><strong>Extraedge:</strong></p><p>Enzyme-linked immunosorbent assay (ELISA) is a heterogeneous EIA technique used in clinical analyses.[1] In this type of assay, one of the reaction components is nonspecifically adsorbed or covalently bound to the surface of a solid phase, such as a microtiter well, a magnetic particle, or a plastic bead</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is true regarding target and sequential steps in the immunological assay depicted in the image below?", "options": [{"label": "A", "text": "Detection of antigen (uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}, {"label": "B", "text": "Detection of antigen (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}, {"label": "C", "text": "Detection of antibody (uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}, {"label": "D", "text": "Detection of antibody (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer)", "correct": true}], "correct_answer": "D. Detection of antibody (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer)", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245067152-QTDV042022IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Detection of antibody (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer) The above-depicted image refers to Indirect ELISA.</p>\n<p><strong>Highyeild:</strong></p><p>Indirect ELISA is a technique that uses a two-step process for detection, whereby a primary antibody specific for the antigen binds to the target, and a labeled secondary antibody against the host species of the primary antibody binds to the primary antibody for detection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The other options are wrong about Indirect Elisa Option A. is true about Direct ELISA</p>\n<p><strong>Extraedge:</strong></p><p>ELISA (which stands for enzyme-linked immunosorbent assay) is a technique to detect the presence of antigens in biological samples. An ELISA, like other types of immunoassays, relies on antibodies to detect a target antigen using highly specific antibody-antigen interactions.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is true regarding target and sequential steps in the immunological assay depicted in the image below?", "options": [{"label": "A", "text": "Detection of antigen (Uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer)", "correct": true}, {"label": "B", "text": "Detection of antigen (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}, {"label": "C", "text": "Detection of antibody (Uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}, {"label": "D", "text": "Detection of antibody (microtiter plate with coated antigen-->sample with antibody-->enzyme coated antibody-->wash-->spectrometer)", "correct": false}], "correct_answer": "A. Detection of antigen (Uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer)", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245067186-QTDV042023IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Detection of antigen (Uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer) The above-depicted image refers to Direct ELISA in which antigen is detected (Uncoated microtiter plate-->sample with antigen-->enzyme coated antibody-->wash-->spectrometer) are the sequential steps followed while performing a Direct ELISA.</p>\n<p><strong>Highyeild:</strong></p><p>A direct ELISA (enzyme-linked immunosorbent assay) is a plate-based immunosorbent assay intended for the detection and quantification of a specific analyte (e.g., antigens, antibodies, proteins, hormones, peptides, etc.) from within a complex biological sample.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The other options are wrong about Direct Elisa Option D. Is true about Indirect ELISA.</p>\n<p><strong>Extraedge:</strong></p><p>ELISA's disadvantages are as follows: Inadequate inhibition of immunogenic antigen in ELISA results in false results. Refrigerated transport and storage are necessary because antibodies are proteins. ELISA is labor-intensive and costly to prepare antibodies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Match the following heterophile agglutination tests and their significance in detecting infectious agents:", "options": [{"label": "A", "text": "A -III, B-II, C-I", "correct": true}, {"label": "B", "text": "A-III, B-I, C-II", "correct": false}, {"label": "C", "text": "A-I, B-II, C-III", "correct": false}, {"label": "D", "text": "A-II, B-III, C-I", "correct": false}], "correct_answer": "A. A -III, B-II, C-I", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245067324-QTDV042024IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A -III, B-II, C-I Weil Felix reaction is a heterophile agglutination test which is useful for detecting scrub typhus Proteus antigens are detected in the Weil Felix reaction which show molecular mimicry with rickettsia species. OXK is ++ for scrub typhus</p>\n<p><strong>Highyeild:</strong></p><p>What does Weil-Felix positive mean? Diagnosis of Rickettsia is done with the help of an agglutination test, Weil Felix. Over the years, it has been one of the most extensively used diagnostic procedure for detecting the infection. The basis of the Weil Felix test positive is to detect the anti-rickettsial antibodies present in the patient's serum sample. Disease Weil-Felix OX-19 Ox-2 OX-K Rocky Mountain spotted fever + + + Rickettsial pax - - - Epidemic typhus + - - Endemic typhus + - - Brill-Zinsser disease +|- - - Scrub typhus - - + Trench fever - - - - - - Paul Bunnell test is a heterophile agglutination test useful for laboratory diagnosis of infectious mononucleosis caused by Epstein Barr virus. A Heterophile positive serum >streptococcal MG test is heterophile agglutination test useful for detection of mycoplasma Streptococcal MG test The test is performed by mixing serial dilutions of patients serum with heat killed suspension of Streptococcus MG. The sample is incubated at 37°c The agglutination titer of 1:20 or> is suggestive.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The other combinations are wrong</p>\n<p><strong>Extraedge:</strong></p><p>The Paul Bunnell test is used to screen for Infectious Mononucleosis (IM), which is seen most commonly in adolescents and young adults. IM is caused by the Epstein-Barr virus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Vaccination is based on the principle of:", "options": [{"label": "A", "text": "Agglutination", "correct": false}, {"label": "B", "text": "Phagocytosis", "correct": false}, {"label": "C", "text": "Immunological memory", "correct": true}, {"label": "D", "text": "Clonal deletion", "correct": false}], "correct_answer": "C. Immunological memory", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunological memory Vaccination leads to the production of memory cells against the immunogens, which play an essential role in the prevention of the infection by producing antibodies on subsequent exposure to the organism.</p>\n<p><strong>Highyeild:</strong></p><p>Vaccines contain antigens that stimulate the immune system to produce an immune response that is often similar to the natural infection. With vaccination, however, the recipient is not subjected to the disease and its potential complications.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. When a particulate or insoluble antigen is mixed with its antibody in electrolytes at a suitable temperature and pH, the particles are clumped or agglutinated. Option B. In phagocytosis, the microbe is ingested with the subsequent formation of a phagocytic vacuole (phagosome ). Option D. Clonal deletion is the removal of B or T cells by apoptosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Antibiotic sensitivity testing method shown in the Image is:", "options": [{"label": "A", "text": "Kirby Bauer disc diffusion method", "correct": true}, {"label": "B", "text": "Stokes disk diffusion method", "correct": false}, {"label": "C", "text": "Broth dilution method", "correct": false}, {"label": "D", "text": "Agar dilution method", "correct": false}], "correct_answer": "A. Kirby Bauer disc diffusion method", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689234535537-QTDV025001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Kirby Bauer disc diffusion method The disk diffusion test, agar diffusion test, or Kirby-Bauer test, is an antibiotic susceptibility test. It uses antibiotic discs to test the extent to which bacteria are affected by those antibiotics . In Kirby-Bauer testing, the lawn culture of the test organism is plated on a solid growth medium and antibiotics disks are placed onto this plate. After allowing the bacteria to grow overnight, areas of clear media (zone of inhibition) surrounding the disks indicate that the antibiotic inhibits bacterial growth.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. The Stokes method allows each individual isolate to be compared with a sensitive control of the same or similar species which is subjected to the same technical conditions of medium, incubation time, atmosphere, temperature, etc. Option C. Broth dilution is a technique in which containers holding identical volumes of broth with an anti-microbial solution in incrementally (usually geometrically) increasing concentration are inoculated. Option D. Agar dilution method involves the incorporation of varying desired concentrations of the antimicrobial agent into an agar medium (molten agar medium), habitually using serial two-fold dilutions, followed by the inoculation of a defined microbial inoculum onto the agar plate surface.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The most important mechanism of antibiotic resistance in biofilms is:", "options": [{"label": "A", "text": "Increased adhesion", "correct": false}, {"label": "B", "text": "Increased efflux of the antibiotic", "correct": false}, {"label": "C", "text": "Low mitotic rate", "correct": false}, {"label": "D", "text": "Mechanical barrier", "correct": true}], "correct_answer": "D. Mechanical barrier", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mechanical barrier Antibiotic resistance is the ability of a microorganism to withstand the effects of an antibiotic. A ntibiotic resistance evolves naturally via natural selection through random mutation, but it could also be engineered by applying evolutionary stress to a population. Biofilm bacteria show much greater resistance to antibiotics than their free-living counterparts and our interest is to investigate the mechanistic basis of this phenomenon. One potential reason for this increased resistance is the penetration barrier that biofilms may present to antimicrobials. THIS IS A MECHANICAL FORM OF CAUSING DRUG RESISTANCE Approximately 80% of chronic and recurrent microbial infections in the human body are due to bacterial biofilm. Microbial cells within biofilms have shown 10–1000 times more antibiotic resistance than planktonic.</p>\n<p><strong>Highyeild:</strong></p><p>BIOFILM DEVELOPMENT A biofilm is a system that can be adapted internally to environmental conditions by its inhabitants. The self-produced matrix of extracellular polymeric substances, which is also referred to as slime, is a polymeric conglomeration generally composed of extracellular biopolymers in various</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. All these steps are not the most important in the mechanism of antibiotic resistance.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Bacterial resistance to antibiotics is most commonly transmitted through:", "options": [{"label": "A", "text": "Transformation", "correct": false}, {"label": "B", "text": "Transduction", "correct": false}, {"label": "C", "text": "Conjugation", "correct": true}, {"label": "D", "text": "Plasmid", "correct": false}], "correct_answer": "C. Conjugation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Conjugation Conjugation is the most common mechanism of drug resistance.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Plasmid is most commonly transmitted to other bacteria by:", "options": [{"label": "A", "text": "Transformation", "correct": false}, {"label": "B", "text": "Transduction", "correct": false}, {"label": "C", "text": "Conjugation", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Conjugation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Conjugation Bacterial Conjugation is the transfer of genetic material (PLASMID IN THIS QUESTION) that occurs during the process of bacterial conjugation. During this process, DNA plasmid is transferred from one bacterium the donor of a mating pair into another the recipient via a pilus. Conjugation is a common mechanism of horizontal gene transfer in bacteria that is instrumental in the spread of antibiotic resistance among bacteria. Most resistance genes are found on mobile genetic elements and primarily spread by conjugation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Plasmid or vector transformation is the process by which exogenous DNA is transferred into the host cell . Transformation is the process of random uptake of free or naked DNA fragments from the surrounding medium by a bacterial cell and incorporation of this molecule into its chromosome in a heritable form. It has been studied so far only in certain bacteria: Streptococcus, Bacillus, Haemophilus, Neisseria, Acinetobacter, and Pseudomonas. The Griffith experiment (1928) on mice using pneumococcal strains provided the direct evidence of transformation. Option B. Transduction is the process of using a virus to mediate the delivery of DNA fragments or plasmids into a cell, either prokaryotic or eukaryotic.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following processes occurs by a bacteriophage?", "options": [{"label": "A", "text": "Transformation", "correct": false}, {"label": "B", "text": "Transduction", "correct": true}, {"label": "C", "text": "Transcription", "correct": false}, {"label": "D", "text": "Conjugation", "correct": false}], "correct_answer": "B. Transduction", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Transduction Transduction is the process by which a virus transfers genetic material from one bacterium to another. Viruses called bacteriophages are able to infect bacterial cells and use them as hosts to make more viruses. Transduction is defined as the transmission of a portion of DNA from one bacterium to another by a bacteriophage. Types of transduction Generalized transduction: It involves the transfer of any part of the donor bacterial genome into the recipient bacteria. Restricted or specialized transduction: Here, only a particular genetic segment of the bacterial chromosome that is present adjacent to the phage DNA is transduced. Role of transduction In addition to chromosomal DNA, transduction is also a method of transfer of episomes and plasmids. Drug resistance, e.g. plasmid coded penicillin resistance in staphylococci. Treatment: As a method of genetic engineering in the treatment of some inborn metabolic defects.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Transmission of drug resistance was first observed in:", "options": [{"label": "A", "text": "Shigella", "correct": true}, {"label": "B", "text": "Salmonella Typhi", "correct": false}, {"label": "C", "text": "Vibrio cholera", "correct": false}, {"label": "D", "text": "Escherichia coli", "correct": false}], "correct_answer": "A. Shigella", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Shigella Drug resistance is the reduction in the effectiveness of a medication such as an antimicrobial or an antineoplastic in treating a disease or condition. Antimicrobial drug resistance refers to the acquired ability of a microbial pathogen to resist the effects of a therapeutic agent. Natural resistance to antimicrobial drugs by various mechanisms preventing the drug from being absorbed is capable of transforming the drug, its biotransformation into the cell, or reducing affinity with the drugs’ target. Drug resistance in Shigella spp. can result from many mechanisms, such as a decrease in cellular permeability, and extrusion of drugs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "DNA can be transferred from one bacterium to another by a number of processes. Uptake by a recipient cell of soluble DNA released from a donor cell is defined as which one of the following?", "options": [{"label": "A", "text": "Competence", "correct": false}, {"label": "B", "text": "Conjugation", "correct": false}, {"label": "C", "text": "Recombination", "correct": false}, {"label": "D", "text": "Transformation", "correct": true}], "correct_answer": "D. Transformation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Transformation Transformation is the process of random uptake of free or naked DNA fragments from the surrounding medium by a bacterial cell and incorporation of this molecule into its chromosome in a heritable form. It has been studied so far only in certain bacteria: Streptococcus, Bacillus, Haemophilus, Neisseria, Acinetobacter, and Pseudomonas. The Griffith experiment (1928) on mice using pneumococci strains provided the direct evidence of transformation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Competence is the ability of a cell to alter its genetics by taking up extracellular (naked) DNA from its environment in the process called transformation. Option B. Conjugation is the process by which one bacterium transfers genetic material to another through direct contact. Option C. Recombination is a process by which pieces of DNA are broken and recombined to produce new combinations of alleles.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "F factor integrates with bacterial chromosomes to form:", "options": [{"label": "A", "text": "HFr", "correct": true}, {"label": "B", "text": "RTF+r", "correct": false}, {"label": "C", "text": "F-", "correct": false}, {"label": "D", "text": "RTF", "correct": false}], "correct_answer": "A. HFr", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HFr HFR Conjugation: F factor being a plasmid , it may integrate with bacterial chromosomes and behave as an episome. Such donor cells can transfer chromosomal DNA to recipient cells with high frequency in comparison to F+ cells, therefore, named Hfr cells (high frequency of recombination). During conjugation of an Hfr cell with an F- cell, only a few chromosomal genes along with only a part of the F factor get transferred. Hence, F- recipient cells do not become F+ cells</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The role of plasmids in conjugation was first described by Lederberg and Tatum in:", "options": [{"label": "A", "text": "H. Influenzae", "correct": false}, {"label": "B", "text": "Corynebacterium", "correct": false}, {"label": "C", "text": "Pseudomonas", "correct": false}, {"label": "D", "text": "Esch. Coli", "correct": true}], "correct_answer": "D. Esch. Coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Esch. Coli Demonstration by Lederberg and Tatum of genetic recombination between the transfer of genetic material in E. coli is not reciprocal. Bacteria can transfer plasmids (circles of DNA), through conjugation. Bacterial Conjugation: Transfer of genetic material occurs during the process of bacterial conjugation, During this process, DNA plasmid is transferred from one bacterium (the donor) of a mating pair into another (the recipient) via a pilus. A plasmid is a floating piece of circular DNA in the bacteria separate from its own DNA. During bacterial conjugation, the \"donor\" bacteria donates to the \"recipient\" bacteria new genetic information that may contain genes such as resistance to certain antibiotics. During classical E. coli conjugation, the donor cell provides a conjugative or mobilizable genetic element that is most often a plasmid or transposon. Most conjugative plasmids have systems ensuring that the recipient cell does not already contain a similar element.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The discovery of “gene transformation” came from the study of one of the following bacteria:", "options": [{"label": "A", "text": "Bacillus subtilis", "correct": false}, {"label": "B", "text": "Streptococcus pyogenes", "correct": false}, {"label": "C", "text": "Streptococcus pneumonia", "correct": true}, {"label": "D", "text": "Escherichia coli", "correct": false}], "correct_answer": "C. Streptococcus pneumonia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus pneumonia Transformation in bacteria was f irst demonstrated in 1928 by the British bacteriologist Frederick Griffith . Griffith was interested in determining whether injections of heat-killed bacteria could be used to vaccinate mice against pneumonia. Genetic transformation involves the transfer and incorporation of foreign DNA into a host genome. For this transferred DNA to be transmitted to later generations, the transformation of the germline or other appropriate cells of the recipient species is essential. The purpose of this technique is to introduce a foreign plasmid into bacteria, the bacteria then amplify the plasmid, making large quantities of it.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Viral genomes integrated into the bacterial genomes are known as:", "options": [{"label": "A", "text": "Prophage", "correct": true}, {"label": "B", "text": "Temperate phage", "correct": false}, {"label": "C", "text": "Bacteriophage", "correct": false}, {"label": "D", "text": "Metaphage", "correct": false}], "correct_answer": "A. Prophage", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Prophage During the temperate or lysogenic life cycle, the phage DNA remains integrated with the bacterial chromosome as prophage. The prophage acts as an additional chromosomal element that encodes for new characters in the daughter cells. Imparts toxigenicity to the bacteria: Phage DNA may code for various toxins abbreviated as ABCDE: (A and C of Streptococcus pyrogenic exotoxin (SPE), Botulinum toxin C and D, Cholera toxin, Diphtheria toxin and E. coli (Verocytotoxin)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. The bacteriophage that can enter into a lysogenic relationship with its host is called a temperate phage. Option C. Bacteriophages aka phages are viruses that infect bacterial cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Correct sequence of bacterial growth curve:", "options": [{"label": "A", "text": "Log phase-Lag Phase-Stationary phase-Decline phase", "correct": false}, {"label": "B", "text": "Lag Phase- Log phase -Stationary phase-Decline phase", "correct": true}, {"label": "C", "text": "Stationary phase-Lag Phase- Log phase - Decline phase", "correct": false}, {"label": "D", "text": "Lag Phase- Exponential phase- Log phase - Death phase", "correct": false}], "correct_answer": "B. Lag Phase- Log phase -Stationary phase-Decline phase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lag Phase- Log phase -Stationary phase-Decline phase The bacterial growth curve represents the number of live cells in a bacterial population over some time. There are four distinct phases of the growth curve: lag phase exponential (log) phase stationary phase and decline phase The decline phase is characterized by an exponential decrease in the number of living cells. The study of bacterial growth curves is important when aiming to utilize or inoculate known numbers of the bacterial isolate, for example, to enhance plant growth, increase biodegradation of toxic organics, or produce antibiotics or other natural products at an industrial scale.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Packaging of chromosomal DNA into a virus produces:", "options": [{"label": "A", "text": "Hfr", "correct": false}, {"label": "B", "text": "Plasmid", "correct": false}, {"label": "C", "text": "Transducing phage", "correct": true}, {"label": "D", "text": "F’", "correct": false}], "correct_answer": "C. Transducing phage", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Transducing phage Transducing phages accidentally packages host DNA into a small fraction of the phage capsids produced during lytic infection. Phage P1 is a commonly used generalized transducing phage for E.Coli. Any region of the bacterial chromosome can be transferred by a generalized transducing phage. Specialized transducing phages are phages that have a segment of bacterial DNA integrated into their genome.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Hfr Conjugation: F factor being a plasmid, it may integrate with bacterial chromosomes and behave as an episome. Such donor cells can transfer chromosomal DNA to recipient cells with high frequency in comparison to F+ cells, therefore, named Hfr cells (high frequency of recombination). During conjugation of an Hfr cell with an F- cell, only a few chromosomal genes along with only a part of the F factor get transferred. Hence, F- recipient cells do not become F+ cells Option B. A plasmid is a small, extrachromosomal DNA molecule within a cell that is physically separated from chromosomal DNA and can replicate independently. Option D, F’ means fertility factor, it allows genes to be transferred from one bacterium carrying the factor to another bacterium lacking the factor by conjugation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In the extracellular medium, DNA-destroying enzymes would likely prevent the transfer of DNA by:", "options": [{"label": "A", "text": "Conjugation", "correct": false}, {"label": "B", "text": "Natural transformation", "correct": true}, {"label": "C", "text": "Specialized transduction", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "B. Natural transformation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Natural transformation Natural transformation is a bacterial adaptation for DNA transfer that depends on the expression of numerous bacterial genes whose products appear to be responsible for this process. The length transferred is likely double-stranded DNA and is often more than a third of the total chromosome length. Bacterial transformation may be referred to as a stable genetic change, brought about by the uptake of naked DNA. Certain enzymes, called endonucleases, are attracted to DNA/RNA hybrids that form when gene transcription goes awry — and they cut the DNA like scissors to damage it .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Conjugation is the process by which one bacterium transfers genetic material to another through direct contact. Option C. Specialized transduction is the process by which a restricted set of bacterial genes are transferred to another bacterium. The genes that get transferred (donor genes) depend on where the phage genome is located on the chromosome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following organisms are known to survive intracellularly except:", "options": [{"label": "A", "text": "Brucella suis", "correct": false}, {"label": "B", "text": "Salmonella Enterica", "correct": false}, {"label": "C", "text": "Streptococcus pyogenes", "correct": true}, {"label": "D", "text": "Listeria", "correct": false}], "correct_answer": "C. Streptococcus pyogenes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus pyogenes Streptococcus pyogenes, or Group A streptococcus (GAS), is a facultative, Gram-positive coccus that grows in chains and causes numerous infections in humans including pharyngitis, tonsillitis, scarlet fever, cellulitis, erysipelas, rheumatic fever, post-streptococcal glomerulonephritis. Streptococcus pyogenes is generally an extracellular pathogen.</p>\n<p><strong>Highyeild:</strong></p><p>INTRACELLULAR ORGANISMS: Obligate Facultative Bacteria Viruses Protozoa Rickettsia sp. Chlamydia sp. Anaplasma sp. Coxiella burnetti Ehrlichia sp. Mycobacterium leprae All viruses Plasmodium Protozoa Babesia Leishmania Toxoplasma gondii Trypanosoma cruzi Bacteria Fungi Protozoa Francisella tularensis Listeria monocytogenes Mycobacterium sp. Brucella sp. Salmonella sp. Legionella pneumophila Yersinia sp. Nocardia sp. Borrelia sp. Histoplasma capsulatum Trypanosoma</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Intracellular bacterial pathogens, such as Mycobacterium tuberculosis, Salmonella enterica, Brucella suis, or Listeria monocytogenes, can replicate within host cells. Remember- Chlamydia evades phagolysosome fusion, hence can survive intracellularly.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Bacteria protect themselves from viruses by fragmenting viral DNA upon entry by:", "options": [{"label": "A", "text": "Ligases", "correct": false}, {"label": "B", "text": "Endonucleases", "correct": true}, {"label": "C", "text": "Methylases", "correct": false}, {"label": "D", "text": "Vectors", "correct": false}], "correct_answer": "B. Endonucleases", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Endonucleases Endonucleases are enzymes that cleave the phosphodiester bond within a polynucleotide chain. Some of them have no regard for the sequence when cutting DNA, but many others do so only at specific nucleotide sequences. The latter group is often called restriction endonucleases or restriction enzymes. Endonucleases are enzymes that cleave the phosphodiester bond within a polynucleotide chain. Restriction enzymes are endonucleases from eubacteria and archaea that recognize a specific DNA sequence. The nucleotide sequence recognized for cleavage by a restriction enzyme is called the restriction site.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Ligases are enzymes that are capable of catalyzing the reaction of joining two large molecules by establishing a new chemical bond, generally with concomitant hydrolysis of a small chemical group on one of the bulky molecules or simply linking of two compounds together. Option C. Methylase is an enzyme (a protein that speeds up the chemical reaction in the body) that attaches methyl group to DNA Option D. A vector is any particle used as a vehicle to artificially carry a foreign nucleic sequence – usually DNA – into another cell, where it can be replicated and/or expressed.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Bacterial DNA is not cleaved by their restriction enzymes because bacteria add _______________ to their DNA:", "options": [{"label": "A", "text": "Peptides", "correct": false}, {"label": "B", "text": "Nucleotides", "correct": false}, {"label": "C", "text": "Methyl groups", "correct": true}, {"label": "D", "text": "Glycerophosphate", "correct": false}], "correct_answer": "C. Methyl groups", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Methyl groups Bacteria prevent their DNA from being chopped down by restriction enzymes through the methylation of the restriction sites. Methylation of DNA is a very familiar way to modify DNA function and bacterial DNA is highly methylated. The overall process is called the restriction modification system. To prevent the destruction of its DNA by restriction enzymes, methyl groups are added.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. A peptide is a short chain of amino acids Option B. Nucleotides are organic molecules consisting of a nucleoside and a phosphate.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following enzymes obtained from Thermus aquaticus herb is an important component of PCR/ Polymerase Chain Reaction?", "options": [{"label": "A", "text": "Restriction endonuclease I", "correct": false}, {"label": "B", "text": "Restriction endonuclease II", "correct": false}, {"label": "C", "text": "RNA polymerase", "correct": false}, {"label": "D", "text": "DNA polymerase", "correct": true}], "correct_answer": "D. DNA polymerase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>DNA polymerase It is the source of the heat-resistant enzyme Taq DNA Polymerase. A DNA polymerase is a member of a family of enzymes that catalyze the synthesis of DNA molecules from nucleoside triphosphates, the molecular precursors of DNA. These enzymes are essential for DNA replication and usually work in groups to create two identical DNA duplexes from a single original DNA duplex. Thermus aquaticus is a species of bacteria that can tolerate high temperatures, one of several thermophilic bacteria. Between 70-75°C, the base pairing between the primers and the template DNA is much more specific than at 37°C, the optimal temperature for E. coli DNA polymerase. This minimizes the chances of annealing of primers to imperfectly matched sequences and thereby, amplification of unwanted DNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & B. These are microbial enzymes that cleave double-stranded DNA at specific oligonucleotide sequences. They split DNA strands into fragments of varying lengths which can be separated by gel electrophoresis. Useful in DNA fingerprinting and southern blot. Option C. RNA polymerase is an enzyme that is responsible for copying a DNA sequence into an RNA sequence during the process of transcription</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the principle of this test?", "options": [{"label": "A", "text": "Immunochromatography", "correct": true}, {"label": "B", "text": "Chemiluminescence", "correct": false}, {"label": "C", "text": "ELISA enzyme-linked immunoassay", "correct": false}, {"label": "D", "text": "Immunofluorescence", "correct": false}], "correct_answer": "A. Immunochromatography", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689234544713-QTDV025020IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunochromatography Immunochromatography assay (ICA), namely lateral flow test, is a simple device intended to detect the presence or absence of the target analyte. Principle of Immunochromatography: The principle of immunochromatography is the same as the ELISA sandwich method, the only difference is that the immunological reaction is carried out on the chromatographic paper by capillary action . For this system, two kinds of specific antibodies against antigens are used Rapid diagnostic tests or RDTs are lateral flow immuno-chromatographic antigen tests, which rely on the capture of dye-labeled antibodies to produce a visible band on a strip of nitrocellulose, often encased in a plastic housing, referred to as cassettes. RDTs are also available for the detection of antibodies.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Chemiluminescence is defined as the emission of electromagnetic radiation caused by a chemical reaction to produce light. Chemiluminescence immunoassay (CLIA) is an assay that combines chemiluminescence techniques with immunochemical reactions. CLIA utilizes chemical probes which could generate light emission through a chemical reaction to label the antibody. Option C. ELISA is used to detect antigens in a biological sample. It depends on antibodies to detect a target antigen using highly specific antibody-antigen interactions. Option D. In immunofluorescence, specific antibodies are chemically labeled with a fluorochrome such as a fluorescein isothiocyanate. These fluorescent antibodies are then added to a microscope slide containing a clinical specimen, the antibodies bind to antigens in the specimen causing them to fluoresce when exposed to UV light.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following botulinum toxins is mediated by lysogenic conversion?", "options": [{"label": "A", "text": "A and C", "correct": false}, {"label": "B", "text": "A and B.", "correct": false}, {"label": "C", "text": "C and D", "correct": true}, {"label": "D", "text": "B and F", "correct": false}], "correct_answer": "C. C and D", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C and D C. botulinum is is non-invasive and the pathogenesis is due to the production of the powerful neurotoxin ‘botulinum toxin’(BT), probably the most toxic substance known to be lethal to mankind: Serotype: Based on the light chain, there are eight serotypes-A, B, C1, C2, D, E, F, and G: Serotypes A, B, and E commonly cause human disease; the most severe being serotype A. All serotypes produce neurotoxins; except C2 which produces an enterotoxin Botulinum toxin Types C and D are bacteriophage coded(lysogenic conversion) BT is produced intracellularly, not secreted, and appears outside only after the autolysis of bacterial cells. BT is synthesized as protoxin, convened sorted into an active form by proteolytic enzymes. A and C of Streptococcus pyrogenic exotoxin (SPE), Botulinum toxin C and D, Cholera toxin, Diphtheria toxin, and E. coli (Verocytotoxin) are mediated by lysogenic conversion. Options A, B, and D. Botulinum toxins are A, B, C, D, E, F, and G out of these except for C and D Lysogenic conversion is not seen in other serotypes. Target proteins of the SNARE complex in different types of botulinum toxin 5 Type of BONT BoNT/A BoNT/B BoNT/C BoNT/D BoNT/E BoNT/F BoNT/G Target Proteins SNAP-25 VAMP/ Synaptobrevin Syntaxin 1A, 1B, SNAP-25 VAMP/Synaptobrevin, Cellubrevin SNAP-25 VAMP/Synaptobrevin, Cellubrevin VAMP/ Synaptobrevin</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Early attempts at the polymerase chain reaction (PCR) used E. coli DNA polymerase. This was replaced with DNA polymerase from Thermus aquaticus (“Taq” polymerase). Which is the primary advantage of using this enzyme?", "options": [{"label": "A", "text": "It is cheaper than E.coli polymerase", "correct": false}, {"label": "B", "text": "Specificity is increased because nonspecific hybridization of primers does not occur", "correct": true}, {"label": "C", "text": "Use of Taq polymerase enables lower temperatures to be used.", "correct": false}, {"label": "D", "text": "Use of Taq polymerase results in fewer PCR cycles.", "correct": false}], "correct_answer": "B. Specificity is increased because nonspecific hybridization of primers does not occur", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Specificity is increased because nonspecific hybridization of primers does not occur Thermus aquaticus is a species of bacteria that can tolerate high temperatures, one of several thermophilic bacteria that belong to the Deinococcus-Thermus Between 70-75 deg C, the base pairing between the primers and the template DNA is much more specific than at 37 deg C, the optimal temperature for E. coli DNA polymerase. This minimizes the chances of annealing of primers to imperfectly matched sequences and thereby, amplification of unwanted DNA. The DNA polymerase typically used in PCR is called Taq polymerase, after the heat-tolerant bacterium from which it was isolated (Thermus aquaticus). This heat stability makes Taq polymerase ideal for PCR. Due to its key role in synthesizing and amplifying new strands of DNA, Taq DNA Polymerase is essential to Polymerase Chain Reaction (PCR). Like other DNA polymerases, Taq Polymerase can only produce DNA if it has a primer, a short sequence of 20 nucleotides that provide a starting point for DNA synthesis. Taq polymerase was identified as an enzyme able to withstand the protein-denaturing conditions (high temperature) required during PCR. Therefore, it replaced the DNA polymerase from E. coli originally used in PCR.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following statements regarding pFra/pMT plasmid are true except:", "options": [{"label": "A", "text": "It encodes the capsular protein (Fraction 1 antigen FI ) that confers antiphagocytic properties", "correct": false}, {"label": "B", "text": "It contains genes for a plasminogen activating protease that has temperature-sensitive coagulase activity.", "correct": true}, {"label": "C", "text": "It encodes factors that are important for survival in both the flea and humans", "correct": false}, {"label": "D", "text": "It is unique to Y. Pestis.", "correct": false}], "correct_answer": "B. It contains genes for a plasminogen activating protease that has temperature-sensitive coagulase activity.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It contains genes for a plasminogen activating protease that has temperature-sensitive coagulase activity. Other options A, C, and D. Are correct. Yersinia pestis, the causative agent of plague, harbors at least three plasmids necessary for full virulence of the organism, two of which are species-specific. One of the Y. pestis-specific plasmids, pMT1, is thought to promote deep tissue invasion, resulting in more acute onset of symptoms and death. The pFra plasmid also designated pYT and pMT1 are unique to Y. pestis (option D). It is typically 100 kb, but its size can vary drastically among various strains, ranging from 60 kb in the deleted version of the Dodson strain to 280 kb in other strains The plasmid’s role in Y. pestis virulence is not fully understood, but it is known to contain genes that encode two virulence factors: (i) the F1 protective antigen associated with increased resistance to phagocytosis by monocytes and (ii) the Y. pestis murine toxin (YMT), a phospholipase D encoded by ymt, whose intracellular activity protects Y. pestis from digestion in the flea gut; (optionA and C) Thus, facilitating the bacterium’s ability to colonize the flea’s midgut and to increase its arthropod-borne transmission.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. The pfra/pMT plasmid encodes the capsular protein (fraction F1) that is produced mainly at 37°C and confers antiphagocytic properties Option C. It contains genes that encode phospholipase D, which is required for organism survival. In flea midgut Option D. It is unique to Y.pestis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "All statements given below are true regarding Antigenic alterations, except:", "options": [{"label": "A", "text": "Drug-induced anaemias, leucopenias and thrombocytopenias often have an autoimmune basis.", "correct": false}, {"label": "B", "text": "Viral infections, such as infectious mononucleosis, often precede autoimmune disease.", "correct": false}, {"label": "C", "text": "Neoantigens can arise from Physical agents such as photosensitivity and cold allergy.", "correct": false}, {"label": "D", "text": "Neoantigens cannot arise by mutation.", "correct": true}], "correct_answer": "D. Neoantigens cannot arise by mutation.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neoantigens cannot arise by mutation. This is incorrect, as explained below. Antigenic alterations: Cells or tissues may undergo antigenic alterations due to physical, chemical and biological influences. Such altered or 'neoantigens' may elicit an immune response.</p>\n<p><strong>Highyeild:</strong></p><p>Bacterial enzymes also induce the alteration of cell antigens. Neuraminidases formed by myxoviruses and many bacteria act on erythrocytes releasing the T antigen. Neoantigens may also arise by mutation. Such mutant cells may be immunogenic.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Neoantigens can arise from Physical agents such as irradiation, photosensitivity and cold allergy. Option A. Drug-induced anaemias, leucopenias and thrombocytopenias often have an autoimmune basis. Infectious microorganisms, particularly viruses and other intracellular pathogens may induce alteration of cell antigens. Option B. Viral infections, such as infectious mononucleosis, often precede autoimmune disease.</p>\n<p><strong>Extraedge:</strong></p><p>Tumor antigen is an antigenic substance produced in tumor cells, i.e., it triggers an immune response in the host. Tumor antigens are useful tumor markers in identifying tumor cells with diagnostic tests and are potential candidates for use in cancer therapy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You see a case of orchitis following mumps in the OPD. The pathogenesis of sperm antigens to damage the seminiferous tubules is explained by:", "options": [{"label": "A", "text": "Antigenic alteration", "correct": false}, {"label": "B", "text": "Sequestered antigens", "correct": true}, {"label": "C", "text": "Cross-reacting foreign antigens", "correct": false}, {"label": "D", "text": "Molecular mimicry", "correct": false}], "correct_answer": "B. Sequestered antigens", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sequestered antigens An example of 'sequestration in time', e., sequestered antigens, is seen with sperm antigens.</p>\n<p><strong>Highyeild:</strong></p><p>As spermatozoa develop only with puberty, the antigen cannot induce tolerance during fetal life. The sperm antigen is therefore not recognised as self, and when it enters circulation, it is immunogenic. This is believed to explain the pathogenesis of orchitis following mumps. The· Virus damages the basement membrane of seminiferous tubules, leading to leakage of sperms and initiation of an immune response, resulting in orchitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Antigenic alterations. Cells or tissues may undergo antigenic alterations due to physical, chemical and biological influences. Such altered or 'neoantigens' may elicit an immune response. Option C. Cross-reacting foreign antigens: The fortuitous similarity between some foreign and self-antigens is the basis of the 'cross-reacting antigen' theory of autoimmunity. Organ-specific antigens are present in several species. Injection of heterologous organ-specific antigens may induce an immune response, damaging the particular organ or tissue in the host. Option D. Molecular mimicry is due to some infecting microorganisms and self-antigen of epitopes with identical peptide sequences (instead of similarities in 'cross-reactions'). Examples of such homologous sequences are seen in arthritogenic Shigella flexneri and HLA-B27, Mycobacterium tuberculosis and joint membranes, Coxsackie B and myocardium</p>\n<p><strong>Extraedge:</strong></p><p>Sequestered antigens are not physiologically in contact with IS cells. In the body, it is located in a localization isolated from the action of leukocytes, antibodies and complement (isolated from the bloodstream, tissue fluid, lymph).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You come across a patient with autoimmune hemolytic anaemia during your OPD posting. All of the given statements below are true with respect to Cold autoantibodies, except:", "options": [{"label": "A", "text": "They are complete agglutinating antibodies belonging to the lgM class", "correct": false}, {"label": "B", "text": "They agglutinate erythrocytes at 37°C but not at four °C", "correct": true}, {"label": "C", "text": "Can be seen in trypanosomiasis and black water fever", "correct": false}, {"label": "D", "text": "Can be seen in primary atypical pneumonia", "correct": false}], "correct_answer": "B. They agglutinate erythrocytes at 37°C but not at four °C", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>They agglutinate erythrocytes at 37°C but not at four °C Option B. incorrect, as explained below Autoimmune hemolytic anaemias: Autoantibodies against erythrocytes are demonstrable in this condition. Serologically, two groups of autoimmune anaemias can be distinguished, characterised by 'cold' and 'warm' antibodies, respectively. The cold autoantibodies are, generally, complete agglutinating antibodies belonging to the IgM class (OPTION A) and agglutinate erythrocytes at four °C but not at three 7°C. (OPTION B) This condition, which used to accompany syphilitic infection frequently, is seldom seen nowadays. Cold agglutinins are also seen in primary atypical pneumonia (OPTION D), trypanosomiasis and black water fever. (OPTION C) Warm autoantibodies are generally incomplete, non-agglutinating antibodies usually belonging to the IgG class and frequently seen in patients taking certain drugs such as sulphonamides, antibiotics and alpha methyl dopa. In autoimmune anaemias, the red cells coated with antibodies are prematurely destroyed in the spleen and liver. Complement-dependent intravascular hemolysis appears to be a rare event.</p>\n<p><strong>Extraedge:</strong></p><p>Autoimmune hemolytic anemia (AIHA) is a decompensated acquired hemolysis caused by the host's immune system acting against its own red cell antigens. Consequent complement activation can impact the clinical picture and is an emerging target for therapeutic approaches.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old woman presents to your clinic with complaints of blurred and double vision, drooping of eyelids, facial muscular pain, and difficulty lifting her arms. She is diagnosed with Myasthenia Gravis. The statements below are all true, except:", "options": [{"label": "A", "text": "Muscle fatigues are abnormal due to malfunction of the myoneural junction.", "correct": false}, {"label": "B", "text": "An antibody against the serotonin receptor on myoneural junctions of striated muscles is present in these patients.", "correct": true}, {"label": "C", "text": "The thymus shows lymphoid hyperplasia and numerous germinal centres", "correct": false}, {"label": "D", "text": "The pathogenic factor in neonatal myasthenia is the autoantibody passively acquired from the mother", "correct": false}], "correct_answer": "B. An antibody against the serotonin receptor on myoneural junctions of striated muscles is present in these patients.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>An antibody against the serotonin receptor on myoneural junctions of striated muscles is present in these patients.</p>\n<p><strong>Highyeild:</strong></p><p>Myasthenia gravis is an autoimmune disorder affecting the neuromuscular junction. It manifests as a generalised muscle weakness involving the respiratory muscles and can lead to a myasthenic crisis, a medical emergency.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Myasthenia gravis: In this disease, muscles are tired due to malfunction of the myoneural junction. An antibody against the acetyl choline receptor on my oneural junctions of striated muscles is present in these patients. (OPTION B) This prevents acetyl choline from combining with its receptor, and impairs muscular contraction. The thymus shows lymphoid hyperplasia and numerous germinal centres. (OPTION C) Infants born to affected mothers show symptoms of the disease but recover spontaneously by the age of two months, coinciding with the disappearance of maternal antibodies. (OPTION D) This suggests that the pathogenic factor in neonatal myasthenia may be the autoantibody passively acquired from the mother.</p>\n<p><strong>Extraedge:</strong></p><p>Myasthenia gravis (MG) is an autoimmune disease, meaning the body's immune system mistakenly attacks its own parts. MG affects the communication between nerves and muscles (the neuromuscular junction). People with MG lose the ability to control muscles voluntarily.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You are posted in the Rheumatology clinic for a month and come across a Sjogren syndrome patient. The triad does not consist of the following:", "options": [{"label": "A", "text": "Dry eyes", "correct": false}, {"label": "B", "text": "Dry mouth", "correct": false}, {"label": "C", "text": "Rheumatoid arthritis", "correct": false}, {"label": "D", "text": "Gout", "correct": true}], "correct_answer": "D. Gout", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gout It doesn’t belong to the triad of syndrome.</p>\n<p><strong>Highyeild:</strong></p><p>An immune system disorder characterised by dry eyes and dry mouth. With this disorder, the body's immune system attacks its healthy cells that produce saliva and tears. Sjögren's syndrome often occurs with other disorders like rheumatoid arthritis and lupus. The main symptoms are dry mouth and eyes. Treatments include eye drops, medication and eye surgery. Sjogren's syndrome: This is a triad of: -</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Conjunctivitis sicca Option B. Dryness of the mouth, with or without salivary gland enlargement Option C. Rheumatoid arthritis The syndrome may be associated with other collagen diseases. Antinuclear antibodies and rheumatoid factor commonly occur in sera.</p>\n<p><strong>Extraedge:</strong></p><p>Symptoms of Sjögren's syndrome dry eyes. a dry mouth. dry skin. tiredness. vaginal dryness. muscle or joint pain. swelling between the jaw and ears (swollen salivary glands) rashes (especially after being in the sun)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 15 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 39-year-old paraplegic man with an indwelling bladder catheter comes to the emergency department complaining of 24 hours of rigors, nausea, and vomiting. His temperature is 38.9 C (102 F). Physical examination shows suprapubic tenderness. Urinalysis shows positive leukocyte esterase and 30-40 PMNs/HPF with bacteria ++. Urine and blood cultures grew non-lactose-fermenting Gram-negative rods. Which of the following pathogens is the most likely culprit?", "options": [{"label": "A", "text": "Enterobacter cloacae", "correct": false}, {"label": "B", "text": "Enterococcus faecalis", "correct": false}, {"label": "C", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "D", "text": "Pseudomonas aeruginosa", "correct": true}], "correct_answer": "D. Pseudomonas aeruginosa", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas aeruginosa Patients with indwelling bladder catheters are at increased risk for urinary tract infections (UTIs) caused by both typical (eg, Escherichia coli, Klebsiella pneumoniae, Staphylococcus saprophyticus, Proteus mirabilis) and opportunistic (eg, Pseudomonas, Enterococcus, other Staphylococci, fungal) organisms. This patient's culture results are consistent with Pseudomonas aeruginosa, the only non-lactose fermenting, Gram-negative rod listed.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Enterobacter cloacae is a lactose-fermenting , Gram-negative rod characterized by extensive antibiotic resistance. It causes nosocomial infections, including UTIs, pneumonia, and surgical site infections. Option B: Enterococcus faecalis is a Gram-positive Coccus in the Enterococcaceae family that is a common cause of opportunistic UTIs. Vancomycin-resistant Enterococcus is a particularly fearsome isolate that is increasing in prevalence and is associated with many nosocomial infections. Option C: Klebsiella pneumoniae is a lactose-fermenting, Gram-negative rod. It is a common cause of spontaneous bacterial peritonitis and nosocomial pneumonia as well as UTIs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old woman comes to the office due to 2 days of burning micturition and increased urinary frequency and urgency. The patient has had no fever, chills, nausea, vomiting, flank pain, or vaginal discharge. She has no other medical conditions and does not use tobacco, alcohol, or drugs. The patient is sexually active with her boyfriend and takes an oral contraceptive for birth control. Vital signs are within normal limits. Physical examination shows mild suprapubic tenderness. Which of the following pathogens is most likely responsible for this patient's symptoms?", "options": [{"label": "A", "text": "Candida albicans", "correct": false}, {"label": "B", "text": "Chlamydia trachomatis", "correct": false}, {"label": "C", "text": "Escherichia coli", "correct": true}, {"label": "D", "text": "Gardnerella vaginalis", "correct": false}], "correct_answer": "C. Escherichia coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Escherichia coli This patient with painful micturition, urinary frequency/urgency, and suprapubic tenderness has acute cystitis, a urinary tract infection (UTI) confined to the bladder. In most cases, fecal organisms gain access to the urethral meatus and subsequently ascend into the bladder. Escherichia coli, a gram-negative coliform bacteria is the most common pathogen for UTIs; other Enterobacteriaceae organisms, such as Klebsiella pneumonia and Proteus mirabilis are also common but much less so than E coli. Women develop UTls much more often than men due to the proximity of the urethral opening with the anus and the a natomy of the female urethra (short length and broad).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Candida albicans is a common cause of vulvovaginitis, which usually presents with vaginal discharge, burning, and perineal pruritis. Option B: Chlamydia trachomatis and Neisseria gonorrhoeae are leading sexually transmitted pathogens. Although urethritis symptoms (eg, dysuria) can occur, most symptomatic women have significant mucopurulent vaginal discharge. Suprapubic tenderness is less common. Option D: Bacterial vaginosis occurs when normal vaginal flora (eg, Lactobacillus) is replaced with facultative anaerobes such as Gardnerella vaginalis. Most cases are asymptomatic, but some individuals have thin, whitish vaginal discharge and a fishy vaginal odor.</p>\n<p><strong>Extraedge:</strong></p><p>Bacterial vaginosis (dysbiosis of the vaginal flora) is associated with an increase in Gardnerella vaginalis or Mobiluncus spp. and a decrease in lactobacilli spp. It is characterized by vaginal discharge which is usually grayish and sometimes frothy, pH above 4.6, has an amine (“fishy”) odor with 10% potassium hydroxide, and Contains clue cells - epithelial cells studded with small Gram-variable coccobacilli.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old woman comes to the physician complaining of fever and dysuria. Her temperature is 37.8 C (100 F), her blood pressure is 122/78 mm Hg, and her pulse is 84/min. Physical examination elicits suprapubic tenderness. Urine dipstick analysis reveals positive leukocyte esterase and nitrite. A subsequent urine culture grows colonies of motile Gram-negative rods on MacConkey agar and beta-hemolysis on blood agar. Which of the following is the most important bacterial factor responsible for this patient's condition?", "options": [{"label": "A", "text": "Capsule", "correct": false}, {"label": "B", "text": "Heat-labile enterotoxin", "correct": false}, {"label": "C", "text": "O antigen", "correct": false}, {"label": "D", "text": "Fimbrial antigen", "correct": true}], "correct_answer": "D. Fimbrial antigen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Fimbrial antigen Escherichia coli is part of the normal bacterial flora of the intestinal tract. It is a motile, Gram-negative bacillus that is facultatively anaerobic and able to ferment both lactose and glucose. Most strains of E coli also demonstrate beta-hemolysis on blood agar. E coli is responsible for urinary tract infections (UTIs), neonatal meningitis, and several types of gastroenteritis. The virulence factors expressed by a particular strain of E coli will determine disease characteristics. Fimbriae, or pili (Type 1 fimbriae, P fimbriae, and S fimbriae), are one of the most important virulence factors expressed by E coli. They permit the adhesion of E coli to epithelial cells, uroepithelial cells, and enterocytes. During sexual intercourse or bladder catheterization, E coli can be propelled into the urethra and bladder from the colonized periurethral region. P-fimbriae (pyelonephritis-associated pili) adhesion then allows uropathogenic E coli to colonize the bladder and ureters, causing cystitis and pyelonephritis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: E coli strains causing neonatal meningitis to synthesize K1 capsular antigens. The K1 antigen is considered the major determinant of virulence among strains of E coli that cause meningitis. Option B: Enterotoxigenic E coli produce heat-stable (ST) and/or heat-labile (LT) enterotoxins. ST activates guanylate cyclase, causing an increase in cGMP. LT activates adenylate cyclase, increasing cAMP levels. In both structure and mode of action, LT is very similar to the cholera toxin. Option C: The O antigen/ somatic antigen is a variable polysaccharide antigen found on the outer membrane that is used to classify Gram-negative bacteria. It is the most extracellular component of lipopolysaccharide.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 72-year-old man is brought to the emergency department from a skilled nursing facility due to altered mental status, skin flushing, and a high fever. His temperature is 38.9 C (102 F), blood pressure is 80/40 mm Hg, pulse is 120/min, and respirations are 26/min. If blood cultures are positive for Escherichia coli, which of the following is the most likely site of infection leading to bacteremia in this patient?", "options": [{"label": "A", "text": "Urinary tract", "correct": true}, {"label": "B", "text": "Small intestine", "correct": false}, {"label": "C", "text": "Skin", "correct": false}, {"label": "D", "text": "Oropharynx", "correct": false}], "correct_answer": "A. Urinary tract", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Urinary tract This elderly patient has a fever, hypotension, tachycardia, altered mental status, and Escherichia coli bacteremia. This is septic shock most likely due to a urinary tract infection (UTI). UTIs are a common cause of sudden disorientation or confusion in the elderly. Predisposing factors include urinary obstruction (eg, benigh prostatic hypertrophy}, fecal incontinence, neurogenic bladder (eg, due to diabetes), and frequent or indwelling catheterization.</p>\n<p><strong>Highyeild:</strong></p><p>Gram-negative sepsis or septic shock can ensue as a result of the body's systemic reaction to lipopolysaccharide endotoxin (a component in some gram-negative bacterial membranes) . Signs of sepsis include hyper- or hypothermia, tachycardia, tachypnea (can lead to respiratory alkalosis}, and leukocytosis. Severe sepsis is marked by organ dysfunction due to poor blood flow (eg, oliguria from poor renal perfusion and altered mental status from poor cerebral perfusion). Diagnosis is done by clinical (qSOFA Score ) and laboratory tests (TLC, CRP, Procalcitonin, Blood culture, etc.). Metabolic lactic acidosis can be seen, particularly during the late stages, due to poor tissue perfusion. Treatment is focused on maintaining blood pressure and organ perfusion with intravenous fluids, administering antibiotics as per the offending organism, and maintaining proper ventilation and oxygenation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: Many microorganisms inhabit the human GI tract as normal flora. Under normal circumstances, small intestine bacteria do not cause systemic disease. Anaerobic or gram-negative rod bacteremia can result from colonic perforation due to surgery, trauma, or wall rupture from certain pathologic processes. However, the likely site of infection in this patient with E coli bacteremia is the genitourinary tract; although it may represent the ultimate site of origin of E coli, the GI tract is not typically a site of infection. Option C: Normal skin flora includes mostly gram-positive organisms such as staphylococci and streptococci. Option D: Bacterial causes of upper respiratory tract infection (eg, Moraxella and Haemophilus) do not usually cause disseminated disease. E coli and other gram-negative rods (Pseudomonas, Acinetobacter, and Klebsiella) would be common causes of healthcare-acquired pneumonia in this nursing home resident; from the lungs, these organisms can easily gain access to the bloodstream and cause sepsis. However, this patient does not have any respiratory symptoms, and E coli sepsis is more commonly due to UTI than pneumonia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old girt comes to the office due to 2 days of a burning sensation with urination. She had sexual intercourse with her partner last week and used a condom as contraception. The patient says, \"I always urinate right after sexual intercourse.\" She has no vaginal discharge, and her vital signs are normal. Examination shows suprapubic tenderness. Urinalysis reveals positive nitrites, positive leukocyte esterase, 50 PMNs/HPF, and many bacteria. Urine β-hCG is negative. Which of the following is the most likely cause of this patient's infection?", "options": [{"label": "A", "text": "Ascending infection", "correct": true}, {"label": "B", "text": "Hematogenous spread of infection", "correct": false}, {"label": "C", "text": "Lymphatic spread of infection", "correct": false}, {"label": "D", "text": "Poor genital hygiene", "correct": false}], "correct_answer": "A. Ascending infection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ascending infection This patient's dysuria, suprapubic tenderness, and urinalysis abnormalities suggest acute cystitis. Women are at much greater risk than men for urinary tract infections (UTIs) because they have a shorter urethra lying in close proximity to the anus and vaginal introitus , which allows enteric flora (eg, Escherichia coli) to spread to the vaginal opening and subsequently ascend through the urethra to the bladder. The major risk factor in otherwise healthy young women is r ecent sexual intercourse . Although urinating after intercourse flushes bacteria from the lower urinary tract (thereby reducing UTI risk), patients may still develop a UTI.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: Hematologic infections generally enter the urinary tract through the glomeruli and cause pyelonephritis. Although pyuria and bacteriuria are usually present, most patients are systemically ill with fever, chills, and/or fatigue. Hematologic dissemination directly to the bladder is uncommon. Option C: Lymphatic spread of infection is common in skin and soft tissue infections (eg, cellulitis) and is often marked by erythematous streaks on the skin. Lymphatic spread to the urinary tract system is uncommon. Option D: Although poor genital hygiene can increase the risk that bacterial spread from the anus to the vaginal introitus, the primary mechanism of acute simple cystitis is the ascending spread of bacteria through the urethra to the bladder.</p>\n<p><strong>Extraedge:</strong></p><p>The bacteria that spread by hematogenous route (also cause by Descending spread) and can be isolated in patients’ urine include: Staphylococcus aureus Candida spp. Salmonella Typhi Note: that Staphylococcus aureus and Candida spp. Can be a cause of UTIs. However, Salmonella Typhi is excreted in urine as a sequelae of enteric fever usually after 3-4 weeks of infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 83-year-old woman is brought to the emergency department from a nursing home with a fever and altered mental status. The patient has a history of hypertension, dementia, and fecal incontinence. Her temperature is 38.3 C (100.9 F), blood pressure is 100/68 mm Hg, and pulse is 114/min. She is lethargic and unable to answer questions. Her abdomen is soft, with suprapubic tenderness. Lungs are clear bilaterally. There is no cardiac murmur or skin rash. Laboratory results are as follows: Blood: Leukocytes: 17,000/mm3 Potassium: 3.8 mEq/L Bicarbonate: 22 mEq/L Creatinine: 0.8 mg/dL Urinalysis: Leukocyte esterase: Positive Nitrites: Positive Leukocytes: 50/hpf A chest x-ray reveals normal-appearing lungs. Blood and urine cultures are performed, and empiric antibiotics are initiated. Urine cultures grow gram-negative rods that are lactose-fermenting and indole-positive. Which of the following is the most likely organism causing this patient's infection?", "options": [{"label": "A", "text": "Enterobacter cloacae", "correct": false}, {"label": "B", "text": "Escherichia coli", "correct": true}, {"label": "C", "text": "Haemophilus influenzae", "correct": false}, {"label": "D", "text": "Proleus mirabilis", "correct": false}], "correct_answer": "B. Escherichia coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Escherichia coli This patient has Urosepsis , as evidenced by the presence of pyuria (leukocytes), leukocyte esterase, and gram-negative rods in the urine. Among the organisms listed, the microbiological features - lactose-fermenting, indole-positive gram-negative rods - are characteristic of Escherichia coli, the most common etiology of UTls among elderly women.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: The indole positivity (ability to convert tryptophan to indole) of E coli distinguishes it from Enterobacter cloacae, another lactose-fermenting gram-negative rod that is a common cause of UTIs in women. Both E. coli and E. cloacae are lactose fermenters. Option C: Haemophilus influenzae are gram-negative organisms that colonize the respiratory tract; they do not typically cause UTIs. These organisms are frequent causes of pneumonia, sinusitis, and meningitis. Option D: Proteus mirabilis are gram-negative organisms that can cause UTIs. However, in contrast to E coli, these organisms are lactose non-fermenters ( form yellow colonies on MacConkey agar).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old sexually active female presents with burning urination, urgency, and frequency. Urine cultures show catalase-positive, gram-positive cocci. The organism responsible for this patient's symptoms is most likely to be:", "options": [{"label": "A", "text": "Coagulase positive", "correct": false}, {"label": "B", "text": "Hemolytic", "correct": false}, {"label": "C", "text": "Novobiocin resistant", "correct": true}, {"label": "D", "text": "DNase positive", "correct": false}], "correct_answer": "C. Novobiocin resistant", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Novobiocin resistant The Staphylococci are Gram-positive cocci that form clusters, pairs, and short chains. The catalase test (with 3% hydrogen peroxide) differentiates Streptococci (catalase-negative) from Staphylococci (catalase-positive). Their ability to clot blood plasma (slide and tube coagulase tests) separates Staphylococci into two groups: the coagulase-positive Staphylococci, which constitutes the most pathogenic species of Staphylococcus aureus, and coagulase-negative staphylococci (CONS), which constitutes S. epidermidis, S. Saprophyticus, S. hemolytic, etc. The coagulase-negative staphylococci exist as part of the normal flora on the skin and in the throat and nose, and only some species can cause infections. S. saprophyticus is a common cause of urinary tract infection in sexually active young women. S. saprophyticus is resistant to novobiocin. When catalase-positive, coagulase-negative gram-positive cocci in clusters are isolated from urine specimens of the above group of patients, the laboratory performs a novobiocin test to distinguish this organism from other CONS.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Coagulase positivity is a characteristic of S. aureus; this is how S. aureus is differentiated from the other species of Staphylococci that do not have coagulase enzyme. Option B: Hemolysis is a typical feature of Streptococci (streptolysin O and streptolysin S) and Staphylococcus aureus (hemolysin). S. saprophyticus usually is non-hemolytic. Option D: DNase is produced by group A streptococcus. DNase degrades DNA in pus to facilitate the spread of the organism. Anti-DNase can be used as a laboratory test in patients who have had streptococcal infection followed by glomerular DNase is not produced by S. saprophyticus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 64-year-old man comes to the office with 2 days of dysuria, urinary frequency, and urgency. He recently underwent a cystoscopy for evaluation of hematuria. The patient has a history of hypertension, type 2 diabetes mellitus, and 30 pack-years of cigarette smoking. His temperature is 38.2 C (100.8 F). On examination, there is suprapubic tenderness on deep palpation. Urinalysis findings are as follows: Leukocyte esterase: Positive Nitrites: negative Bacteria: many White blood cells: 40-50/hpf Red blood cells: 10-20/hpf Midstream urine culture grows gram-positive cocci in chains with growth > 100,000 CFU/ml. The organism responsible for this patient's condition is most likely to demonstrate which of the following?", "options": [{"label": "A", "text": "Ability to decompose hydrogen peroxide", "correct": false}, {"label": "B", "text": "Gamma hemolysis on blood agar", "correct": true}, {"label": "C", "text": "Growth only in the absence of oxygen", "correct": false}, {"label": "D", "text": "Possession of cytochrome oxidase", "correct": false}], "correct_answer": "B. Gamma hemolysis on blood agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gamma hemolysis on blood agar This male patient who recently underwent a genitourinary procedure (cystoscopy) has a urinary tract infection caused by Enterococcus spp. Male UTI is usually uncommon and is called a complicated UTI. Due to the anatomy of male genitalia, UTI mostly occurs post-instrumentation, post-catheterization, uncontrolled blood glucose levels, or anatomical defects (pediatric patients)</p>\n<p><strong>Highyeild:</strong></p><p>Enterococcus spp. Enterococci spp. are gram-positive cocci in pairs and chains and, when grown on blood agar, can show no hemolysis (gamma hemolysis- most common), alpha hemolysis (Incomplete hemolysis), or beta hemolysis (complete hemolysis). Other characteristics of enterococci include pyrrolidonyl arylamidase (PYR) positivity and the ability to grow in bile and in 6.5% sodium chloride. They are unable to convert nitrates to nitrites, explaining this patient's negative result on urinalysis nitrite. Enterococci are part of the normal intestinal flora of humans and animals. Enterococcus faecalis and E faecium are the most prevalent species cultured from humans and can cause urinary tract infections, bacteremia/endocarditis, wound infection, or intraabdominal or pelvic infection in the nosocomial setting. Enterococci have both intrinsic (cephalosporins, low-level aminoglycosides, trimethoprim-sulfamethoxazole) and acquired (vancomycin) resistance to antibiotics, making them important nosocomial pathogens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: The ability to decompose hydrogen peroxide is suggestive of the presence of catalase, which would indicate Staphylococcus (which are gram-positive cocci in clusters, not chains). Option C: Enterococci are facultative anaerobes organisms. Examples of anaerobic gram-positive cocci include Peptostreptococcus and Micrococcus. Option D: Oxidase positivity (possession of cytochrome oxidase) can help identify certain gram-negative organisms (eg, Pseudomonas).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 78-year-old patient with an episode of acute urinary retention was catheterized. Three days later, he developed a fever and suprapubic pain. The culture of the urine revealed a thin film of bacterial growth over the entire blood agar plate, lactose nonfermenting and the urease test was positive. Which is the most likely organism to cause this infection?", "options": [{"label": "A", "text": "Escherichia coli", "correct": false}, {"label": "B", "text": "Helicobacter pylori", "correct": false}, {"label": "C", "text": "Morganella morganii", "correct": false}, {"label": "D", "text": "Proteus mirabilis", "correct": true}], "correct_answer": "D. Proteus mirabilis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Proteus mirabilis Proteus mirabilis is a Gram-negative, facultatively anaerobic, rod-shaped bacterium. It shows swarming motility (the spread of colonies in a uniform pattern all over the agar plate) and urease activity. Urease production and robust swarming motility are two hallmarks of this organism . This species can be identified as a Gram-negative rod that is motile, urease-positive, lactose-non fermenter, indole-negative, and produces hydrogen sulfide. It is a member of the same bacterial family (Enterobacteriaceae) as E. COLI.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: causes UTI, but is lactose fermenting. Option B: not commonly causes UTI so ruled out. Option C: Morganella morganii can rarely cause UTI and is urease positive but shows no swarming.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A urinary tract infection as a result of Proteus mirabilis facilitates the formation of kidney stones because the organism:", "options": [{"label": "A", "text": "Destroys blood vessels in the kidney", "correct": false}, {"label": "B", "text": "Exhibits \"swarming\" motility", "correct": false}, {"label": "C", "text": "Ferments many sugars", "correct": false}, {"label": "D", "text": "Produces a potent urease", "correct": true}], "correct_answer": "D. Produces a potent urease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Produces a potent urease Infection with P. mirabilis tends to result in unique kidney pathology. P. mirabilis is associated with a high incidence of kidney stone formation. Proteus produces the enzyme urease, which can reduce the acidity of the urine, allowing a niche for a stone formation. Once stone formation begins, bacteria can sequester within the stone, making them less susceptible to antibiotic treatment.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: it is not the reason for kidney stones. Option B: it is not the reason for its high propensity for kidney stones. Option C: It is lactose nonfermenting.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Community-acquired urinary tract infection; defined as an infection of the urinary tract that occurs in the community or within less than 48 hours of hospital admission and was not incubating at the time of hospital admission, is the second commonest diagnosed infection in the community. True regarding community-acquired UTI:", "options": [{"label": "A", "text": "The most common cause is enterococci", "correct": false}, {"label": "B", "text": "Urine is to be refrigerated before testing", "correct": false}, {"label": "C", "text": "The most common cause of UTI is E.coli", "correct": true}, {"label": "D", "text": "The most preferred media is blood agar", "correct": false}], "correct_answer": "C. The most common cause of UTI is E.coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The most common cause of UTI is E.coli Both upper UTI (pyelonephritis) and Lower UTI (Cystitis). The most common bacteria found t o cause UTIs is Escherichia coli (E. coli). This type of UTI is usually caused by Escherichia coli (E. coli), a type of bacteria commonly found in the gastrointestinal (GI) tract. Community-acquired UTI is a very common injection. Hospital-acquired UTI is again a very common nosocomial infection, caused by many Multi-drug resistant (MDR) bugs. UTIs are caused by E. coli that live harmlessly in the gut. However, when shed in the feces, the bacteria can spread to the opening of the urinary tract and up to the bladder, where they can cause problems.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: The most common cause is E. coli. Option B: urine is refrigerated only if sample processing is delayed by >4hrs. In routine, urine is to be processed as soon as possible or else the results can be misleading Option D: the best medium is not blood agar but MacConkey agar.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Acute bacterial prostatitis is an infection of the prostate gland that causes pelvic pain and urinary tract symptoms, such as dysuria, urinary frequency, and urinary retention, and may lead to systemic symptoms, such as fevers, chills, nausea, emesis, and malaise. Which organism causes acute bacterial prostatitis?", "options": [{"label": "A", "text": "Enterococcus", "correct": false}, {"label": "B", "text": "Strep viridians", "correct": false}, {"label": "C", "text": "E.coli", "correct": true}, {"label": "D", "text": "Proteus", "correct": false}], "correct_answer": "C. E.coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>E.coli The organisms primarily responsible for acute bacterial prostatitis (ABP) are also those responsible for most urinary tract infections; these include gram-negative members of the Enterobacteriaceae family such as Escherichia coli. Acute prostatitis is usually caused by the same bacteria that cause urinary tract infections (UTIs) or sexually transmitted diseases (STDs). Bacteria can infect the prostate during or after instrumentation such as cystoscopy, catheterization, etc. The most common isolates in acute infections are uropathogenic E. coli strains.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Enterococcus - Enterococci are Gram-positive facultative anaerobic cocci in short and medium chains, which cause difficult-to-treat infections in the nosocomial setting. They are a common cause of UTI, bacteremia, and infective endocarditis and rarely cause intra-abdominal infections and meningitis. Option B. Strep viridian's - The viridans streptococci are a large group of commensal streptococcal Gram-positive bacteria species that are α-hemolytic (incomplete hemolysis), producing a green coloration on blood agar plates, although some species in this group are actually γ-hemolytic, meaning they produce no change on blood agar. Option D. Proteus - Proteus is a genus of Gram-negative bacteria. Proteus bacilli are widely distributed in nature as saprophytes, being found in decomposing animal matter, sewage, manure soil, the mammalian intestine, and human and animal feces. Options A, B, and D are not the MOST correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which is the ideal urine specimen for diagnosis of uropathogenic E.coli :", "options": [{"label": "A", "text": "Early stream urine", "correct": false}, {"label": "B", "text": "Midstream urine", "correct": false}, {"label": "C", "text": "Suprapubic aspiration", "correct": true}, {"label": "D", "text": "From the uro- bag of catheterized patients.", "correct": false}], "correct_answer": "C. Suprapubic aspiration", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Suprapubic aspiration Supra-pubic aspiration of urine is an invasive sample and therefore is not a common sample of choice . However, it is the most sensitive and specific sample for acute UTI diagnosis. It is mostly preferred in sick, comatose patients and in neonates and infants.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: early stream urine is usually contaminated by urethral flora and therefore is not a sample of choice. It is a preferred sample of choice in cases of urethritis for diagnosis of Chlamydia trachomatis and N. gonorrhea if no obvious urethral discharge is present. Option B: Midstream urine is the most common and widely preferred urine sample as it is not invasive and self-collected by the patient. Option D: A urine sample from the urobag is never a sample of choice and is considered as a rejection criterion due to the overgrowth of commensals and contamination in the sample, misleading CFU may grow in culture.</p>\n<p><strong>Extraedge:</strong></p><p>T erminal void urine Schistosoma haematobium, a parasitic infection that results in adult worms residing in the venous plexus of the bladder causes UTI symptoms with hematuria as a significant feature. Detection depends upon microscopy of urine which contains haematobium eggs. Terminal urine is the optimal sample type for microscopy for S. haematobium infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a reliable screening test for UTI:", "options": [{"label": "A", "text": "Wet mount examination.", "correct": false}, {"label": "B", "text": "Bacteremia in urine", "correct": true}, {"label": "C", "text": "Leukocyte esterase test", "correct": false}, {"label": "D", "text": "Griess test.", "correct": false}], "correct_answer": "B. Bacteremia in urine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacteremia in urine Bacteremia in urine is not a reliable indicator because it is a common occurrence and is not always associated with UTI. Bacteria can be present in urine normally without causing disease and should not always be treated without weighing the clinical aspects.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Wet mount examination demonstrates pus cells/ pyuria and bacteria in the urine. Pus cells of more than 8/mm3 are significant pyuria. Option C: Leukocyte esterase is secreted by pus cells and is a rapid, cheaper, sensitive, and specific test. Option D: Griess test is a nitrate reduction test usually associated with UTI by common uropathogens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The pour plate method is a culture technique for uropathogenic E.coli. It is :", "options": [{"label": "A", "text": "The qualitative culture identifies the E.coli.", "correct": false}, {"label": "B", "text": "The quantitative culture was done to count the no of colonies.", "correct": true}, {"label": "C", "text": "Selective culture media that inhibit normal flora of urine.", "correct": false}, {"label": "D", "text": "Differential media differentiates between other bacteria responsible for UTIs.", "correct": false}], "correct_answer": "B. The quantitative culture was done to count the no of colonies.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The quantitative culture was done to count the no of colonies. The pour-plate technique. It is a test to perform a quantitative culture of a sample. The original sample is diluted several times to thin out the population sufficiently. The most diluted samples are then mixed with warm agar and gently poured into Petri dishes. Isolated cells grow into colonies and are used to establish pure cultures and the CFU per unit of the sample.</p>\n<p><strong>Highyeild:</strong></p><p>Miles and Misra method/ pour plate culture: Quantification of certain samples in microbiology is required to assess the significance of the growth obtained which helps to decide whether an isolate is commensal or pathogen when correlated with the clinical picture. Unlike cells in a liquid medium, cells in or on a solid-gelled medium are immobilized. Therefore, if few bacteria are placed in solidified agar, each bacterium will grow by binary fission into an isolated colony. The pour-plate method uses a diluted suspension of cells/ bacteria mixed with melted agar at 50 deg C well separated so that each has a high probability of being derived from a single cell. Repeating this procedure several times ensures that a pure culture will be obtained. It is then poured onto a Petri dish. When the agar solidifies, the cells are immobilized in the agar and grow into convex, complete colonies.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D are not the correct options</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 33-year-old promiscuous, sexually active female, a week after her menstrual period, develops a painful, swollen right knee. The most likely causative organism has which of the following characteristics?", "options": [{"label": "A", "text": "Both hyphae and spores", "correct": false}, {"label": "B", "text": "Can live within neutrophils", "correct": true}, {"label": "C", "text": "Cannot make ATP", "correct": false}, {"label": "D", "text": "No true cell wall", "correct": false}], "correct_answer": "B. Can live within neutrophils", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Can live within neutrophils This type of joint swelling is called reactive arthritis. The most common cause of this is infection by bacteria causing urogenital and gastrointestinal infections. It is most commonly caused by intracellular pathogens. The most likely diagnosis here is Chlamydial genitourinary infection (which can be asymptomatic many times) followed by Reactive arthritis. Reactive arthritis is an arthritis that occurs following an infection and is a form of spondyloarthritis. Reiter’s syndrome is a subset of reactive arthritis and is defined by the c lassical triad of arthritis, urethritis, and conjunctivitis and mostly affects men in their third decade of life. Pathogens commonly associated with this condition are Shigella, Salmonella, Yersinia, Campylobacter, Amoeba, and Chlamydia. Reactive arthritis often has an interval ranging from several days to weeks between the infection and arthritis. It is typically a mono or oligoarticular pattern of arthritis mostly involving the lower extremities.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: This is characteristic of a fungus - which is not the case here. Options C and D are not the correct options that can explain the characteristics of Chlamydia spp.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You receive a urine culture report from the lab of a 45-year-old patient who is a quadriplegic with an indwelling urinary tract catheter. The urine culture is growing >100,000 oxidase-positive gram-negative bacilli. The most likely organism is:", "options": [{"label": "A", "text": "E. coli", "correct": false}, {"label": "B", "text": "Enterococcus", "correct": false}, {"label": "C", "text": "Klebsiella", "correct": false}, {"label": "D", "text": "Pseudomonas aeruginosa", "correct": true}], "correct_answer": "D. Pseudomonas aeruginosa", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas aeruginosa Pseudomonas is the most common pathogen isolated from patients who have been hospitalized longer than 1 week. It is a frequent cause of nosocomial infections such as pneumonia, urinary tract infections (UTIs), and bacteremia. Pseudomonal infections are complicated and can be life-threatening. P. aeruginosa is a non-fermenter gram-negative bacillus, oxidase-positive organism with an intrinsic resistance to multiple antibiotics.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C are all oxidase-negative</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 55-year-old woman is noted to have pyelonephritis with chills and fever. Blood cultures are obtained, and the Gram stain is read preliminarily as consistent with Proteus species. Which of the following bacteria also may be the etiology?", "options": [{"label": "A", "text": "E. coli", "correct": true}, {"label": "B", "text": "Group B Streptococcus", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Streptococcus pyogenes", "correct": false}], "correct_answer": "A. E. coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>E. coli B oth Proteus spp. and E. coli are gram-negative bacilli . This particular question discusses the gram stain findings which are similar in the case of these two organisms. Therefore, as per the options available, E.coli is the correct answer.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B, C & D: Staphylococcus aureus and Streptococcus spp are all gram positive cocci.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 28 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 38-year-old man comes to the office due to worsening fever, chills, malaise, cough, and shortness of breath. He has not travelled recently or been exposed to sick contacts. The temperature is 39.4 C (103 F). There is dullness to percussion and crackles over the right lung. Leukocyte count is elevated, and a chest x-ray reveals a right lung infiltrate. The underlying immune response to this patient's infection primarily involves T helper (Th1) cells, interferon-gamma, and interleukin-2. Which of the following is the most likely pathogen responsible for this patient's pneumonia?", "options": [{"label": "A", "text": "Haemophilus influenzae", "correct": false}, {"label": "B", "text": "Legionella pneumophila", "correct": true}, {"label": "C", "text": "Pseudomonas aeruginosa", "correct": false}, {"label": "D", "text": "Staphylococcus aureus", "correct": false}], "correct_answer": "B. Legionella pneumophila", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Legionella pneumophila This patient has a high fever, cough, leukocytosis, and a right lung infiltrate indicating lobar pneumonia. Lobar pneumonia is most commonly caused by extracellular bacterial pathogens such as Haemophilus influenzae, Staphylococcus aureus, and Streptococcus pneumoniae (Options a, d) . In this case, the cell-mediated immune response components primarily controlled the infection. This suggests that the pneumonia was likely due to an intracellular pathogen such as Legionella pneumophila (a common cause of atypical community-acquired pneumonia).</p>\n<p><strong>Highyeild:</strong></p><p>pathogenesis- legionella pneumonia The immune response to extracellular organisms is primarily mediated by neutrophils early in infection and by the humoral antibody response (B lymphocytes, immunoglobulins, complement) as time goes on. Macrophages phagocytose intracellular pathogens but are initially resistant to destruction due to the presence of virulence factors that inhibit phagosome-lysosome fusion (e.g., Legionella) or phagolysosome acidification (e.g., Mycobacteria tuberculosis), or allow bacteria to escape from the phagolysosome (e.g., Listeria monocytogenes). L egionella and other intracellular pathogens that initially replicate within the phagosome eventually undergo some degree of digestion by lysosomes, leading to the display of bacterial antigens on major histocompatibility complex (MHC) class II molecules. This stimulates naive CD4 T lymphocytes to differentiate into T-helper subtype 1 (Th1) cells. Th1 cells release interferon-gamma, which activates macrophages and allows them to form fully mature (acidified) phagolysosomes capable of efficiently killing the intracellular.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Pseudomonas aeroginosa usually causes hospital-associated pneumonia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The vector responsible for babesiosis can also transmit which of the following organisms?", "options": [{"label": "A", "text": "Borrelia burgdorferi", "correct": true}, {"label": "B", "text": "Dengue virus", "correct": false}, {"label": "C", "text": "Haemophilus influenzae", "correct": false}, {"label": "D", "text": "Histoplasma capsulatum", "correct": false}], "correct_answer": "A. Borrelia burgdorferi", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Borrelia burgdorferi Babesiosis (caused by Babesia microti ) and Lyme disease (caused by Borrelia burgdorferi ) are transmitted by the Ixodes tick and occur in similar geographic regions. Co-infection is common and could be considered in the appropriate epidemiologic setting (e.g., patients who present with babesiosis in a region endemic for Lyme disease and who do not improve despite appropriate treatment). Ixodes are also the vector for human granulocytic anaplasmosis. Aedes mosquitoes transmit dengue virus. influenzae is transmitted by contact/droplet infection. Histoplasma will have a history of exposure to bats or caves.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old previously healthy man comes to the office due to a week of low-grade fever, malaise, sore throat, and persistent nonproductive cough. He does not use tobacco, alcohol, or illicit drugs. The patient takes no medications and has no drug allergies. Physical examination reveals mild pharyngeal erythema, no nasal congestion, and bilateral vesicular breath sounds with no crackles or wheezes. Chest x-ray shows patchy interstitial infiltrates. Sputum Gram stain shows numerous leukocytes but no organisms. Which of the following agents is the best initial treatment for this patient?", "options": [{"label": "A", "text": "Antagonist of folate metabolism", "correct": false}, {"label": "B", "text": "Inhibitor of mycolic acid synthesis", "correct": false}, {"label": "C", "text": "Inhibitor of bacterial protein synthesis", "correct": true}, {"label": "D", "text": "Inhibitor of ergosterol synthesis", "correct": false}], "correct_answer": "C. Inhibitor of bacterial protein synthesis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inhibitor of bacterial protein synthesis This patient with low-grade fever, sore throat, persistent cough, and chest x-ray evidence of a patchy bilateral infiltrate likely has \"walking pneumonia\", a form of atypical pneumonia usually caused by Mycoplasma pneumoniae or Chlamydia pneumoniae. Unlike most bacteria, Mycoplasma and Chlamydia do not have cell walls composed of peptidoglycan. Mycoplasma completely lacks a cell wall, while Chlamydia has a cell wall composed of an alternate protein. Therefore, these pathogens cannot be seen on Gram stain (which stains peptidoglycan) and cannot be treated with antibacterial agents that target peptidoglycans, such as penicillins, cephalosporins, vancomycin, or carbapenems. Treatment requires a bacterial protein synthesis inhibitor such as a macrolide or tetracycline.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Trimethoprim and sulfamethoxazole are folate metabolism antagonists. They are the first-line therapy for Pneumocystis pneumonia, which often presents with subacute pulmonary symptoms and a bilateral patchy interstitial infiltrate. However, most patients have significant shortness of breath, and nearly all are immune-compromised (e.g., AIDS, chronic steroids). Option B. Mycolic acid is found in the cell wall of Mycobacterium and can be targeted by isoniazid, a mycolic acid synthesis inhibitor. Active pulmonary tuberculosis often presents with several weeks of cough, weight loss, malaise, and upper lobe cavitary infiltrates.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old man has non-productive cough for the past 14 days. He feels tired and has a sore throat and headaches. His blood pressure is 130/70 mmHg, RR is 17/min. Chest X-ray is done. X-ray of the chest demonstrates patchy bilateral interstitial infiltrates. With history and clinical investigations, the patient is diagnosed with Atypical pneumonia. Which of the following is the most?", "options": [{"label": "A", "text": "Staphylococcus aureus", "correct": false}, {"label": "B", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "C", "text": "Mycoplasma pneumoniae", "correct": true}, {"label": "D", "text": "E.coli", "correct": false}], "correct_answer": "C. Mycoplasma pneumoniae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mycoplasma pneumoniae With the history and clinical data, a diagnosis of atypical pneumonia is made, and the most likely organism is Mycoplasma pneumoniae. Mycoplasma pneumoniae bacteria commonly cause mild infections of the respiratory system. Lung infections caused by pneumoniae are sometimes called “walking pneumonia” since symptoms are generally mild. M. pneumoniae is a significant cause of acute respiratory tract infection, especially as a potential etiology of the clinical entity termed \"atypical pneumonia\". Initially, it was known as the Eaton agent. pneumoniae can affect the upper or lower respiratory tracts or both. Symptoms commonly appear gradually, during a few days, and can persist for weeks or months. Typical clinical features include initial pharyngitis, sore throat, hoarseness, and fever. An intractable day and night cough characterise the extension of the infection to the lower airways. Initially, cough is non-productive but later may yield small to moderate amounts of non-bloody sputum. Dyspnoea may be evident in more severe cases.</p>\n<p><strong>Highyeild:</strong></p><p>Bacterial causes of atypical pneumonia: Mycoplasma Chlamydia pneumonia Legionella With a history of animal/ zoonotic contact: Psittacosis Q fever Tularemia</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 55-year-old man presents with fever, chills, fatigue, cough, sore throat, and breathlessness for the past 7 days. He describes the cough as productive and says he is constantly fatigued. He says he is a farmer with daily contact with rabbits, horses, sheep, pigeons, and chickens and reports cleaning the barn 3 days before his symptoms started. The patient denies any history of tick bites. A large tender node is palpable in the right axilla. A chest radiograph reveals multiple homogenous opacities in the lower lobe of the right lung and right-sided pleural effusions. Gram staining of a sputum sample is negative for any organism. Serology tests are negative. Which is the most likely causative organism for this patient’s condition?", "options": [{"label": "A", "text": "Francisella tularensis", "correct": true}, {"label": "B", "text": "Bacillus anthracis", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Yersinia pestis", "correct": false}], "correct_answer": "A. Francisella tularensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Francisella tularensis This patient has respiratory or pneumonic tularemia, also known as 'rabbit fever', a zoonotic disease caused by Francisella tularensis , a gram-negative, non-spore-forming intracellular pathogen.</p>\n<p><strong>Highyeild:</strong></p><p>TULARENSIS: The bacterium multiplies within macrophages and primarily targets organs like the lymph nodes, lungs, spleen, kidneys, and liver (see image below for lifecycle). It can be transmitted to humans through arthropod bites, direct contact with infected animals, infectious animal tissues or fluids, ingesting contaminated food or water, or inhaling aerosols. In this case, the patient might have acquired the bacterium by inhaling aerosols from a rabbit carcass or excrement. Symptoms include high-grade fever, cough, chest pain, and dyspnea. The onset of symptoms typically occurs 3–5 days after infection. The patient’s chest radiographic findings are rare, occurring in only about 8% of cases. Most respiratory tularemia shows peribronchial infiltration in the early stages, progressing to multilobar bronchopneumonia infiltration and pleural effusion. Diagnosing tularemia is difficult and is often missed. A combination of clinical features and laboratory tests is helpful. A negative gram stain on a sputum sample does not rule out the disease. The recommended treatment is streptomycin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Bacillus anthracis will have eschar as a finding and a history of animal exposure. Option D. Yersinia pestis will have a history of visiting a war zone/ plague belt (Beed, etc.) Option C. Staph aureus pneumonia (usually secondary infection)will have a primary viral infection, history of diabetes, comorbidities etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 65-year-old diabetic man presents to the emergency room with a severe productive cough producing thick bloody sputum resembling a \"currant-jelly\" appearance. Culture using MacConkey agar reveals pink colonies, with large mucoid colonies on routine laboratory media. Which of the following organisms is most likely responsible for this patient's pneumonia?", "options": [{"label": "A", "text": "Enterobacter cloacae", "correct": false}, {"label": "B", "text": "Escherichia coli", "correct": false}, {"label": "C", "text": "Klebsiella pneumoniae", "correct": true}, {"label": "D", "text": "Pseudomonas aeruginosa", "correct": false}], "correct_answer": "C. Klebsiella pneumoniae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Klebsiella pneumoniae “ Currant jelly” sputum is a hallmark of infection with Klebsiella pneumoniae. pneumoniae infections can carry high antibiotic resistance and lead to significant patient mortality. Severe pneumonia with ‘redcurrant jelly’ sputum and multiple lung abscesses is called Friedlander’s pneumonia and has a high mortality. Specimens may be heavily stained with blood. Select the portion of the sample that is mucoid and blood stained. PSEUDOMONAS pneumonia will have a greenish tinge to the sputum. E. coli and enterobacter pneumonia does not have a currant jelly sputum.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A specimen of thick, bloody sputum from a hospitalised 80-year-old patient with diabetes mellitus and difficulty breathing is sent for laboratory analyses. The tests yield heavy growth of a lactose-positive, nonmotile, gram-negative rod with a large capsule. Which of the following bacteria is most likely to cause pulmonary problems?", "options": [{"label": "A", "text": "Enterobacter aerogenes", "correct": false}, {"label": "B", "text": "Escherichia coli", "correct": false}, {"label": "C", "text": "Klebsiella pneumoniae", "correct": true}, {"label": "D", "text": "Pseudomonas aeruginosa", "correct": false}], "correct_answer": "C. Klebsiella pneumoniae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Klebsiella pneumoniae Klebsiella spp. are facultatively anaerobic, catalase-positive, oxidase-negative, and ferment glucose. Organisms are capsular, which may give colonies a mucoid appearance. The capsule is made of glucuronic acid and pyruvic acid . On Gram stain, organisms may look fat and chunky. They are lactose fermenters and are usually fimbriate but non-motile. They are H2S- and indole-negative (except K. oxytoca, which is indole-positive), are Voges– Proskauer- positive, grow in KCN, and can use citrate as a sole carbon source. Different biochemical tests usually recognise different species of Klebsiella. They can be identified biochemically (API 20E) via MALDI- TOF or automated systems.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "M. pneumoniae induced pneumonia may be rapidly identified by which of the following procedures?", "options": [{"label": "A", "text": "Cold agglutinin test", "correct": true}, {"label": "B", "text": "Culture of respiratory secretions in HeLa cells after", "correct": false}, {"label": "C", "text": "Culture of respiratory secretions on monkey kidney cells", "correct": false}, {"label": "D", "text": "Detection of specific antigens in urine", "correct": false}], "correct_answer": "A. Cold agglutinin test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cold agglutinin test The cold agglutination test is a heterophile tube agglutination test—for patients suffering from primary atypical pneumonia due to Mycoplasma pneumoniae. A cold agglutinin blood test is done to check for conditions that cause the body to make certain types of antibodies called cold agglutinins. The immune system usually makes cold agglutinins in response to infection. They cause red blood cells to clump together (agglutinate) at low temperatures. Cold Agglutination test Positive in Mycoplasma ( Primary Atypical) Pneumonia The patients sera agglutinated human O group erythrocytes o at 4 o c the agglutination being reversible at 37 o c</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements best characterises Moraxella catarrhalis?", "options": [{"label": "A", "text": "A gram-negative, pleomorphic rod that can cause endocarditis", "correct": false}, {"label": "B", "text": "A gram-negative rod, fusiform-shaped, that is associated with periodontal disease but may cause sepsis", "correct": false}, {"label": "C", "text": "The causative agent of rat-bite fever", "correct": false}, {"label": "D", "text": "The causative agent of sinusitis, bronchitis, and pneumonia", "correct": true}], "correct_answer": "D. The causative agent of sinusitis, bronchitis, and pneumonia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The causative agent of sinusitis, bronchitis, and pneumonia</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The gram-negative pleomorphic rod causing endocarditis is usually Haemophilus spp. Option B. Gram-negative fusiform rod associated with dental diseases is Fusobacterium necrophorum. Option C. The causative organism of rat bite fever is Streptobacillus moniliformis .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An aerobic, oxidase-positive organism is isolated from the sputum of a 12-year-old cystic fibrosis patient with pneumonia and lung abscesses. In culture, the organisms have a \"fruity\" odour and form greenish colonies. The etiologic agent of the respiratory tract infection is most likely to be which of the following?", "options": [{"label": "A", "text": "Chlamydia pneumoniae", "correct": false}, {"label": "B", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "C", "text": "Pseudomonas aeruginosa", "correct": true}, {"label": "D", "text": "Serratia marcescens", "correct": false}], "correct_answer": "C. Pseudomonas aeruginosa", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas aeruginosa Pseudomonas aeruginosa causes urinary tract infections, respiratory system infections, dermatitis, soft tissue infections, bacteremia, bone and joint infections, gastrointestinal infections and a variety of systemic infections, particularly in patients with severe burns and in cancer and AIDS patients. The water-soluble pigments, pyocyanin and pyoverdin, give P. aeruginosa its distinctive blue-green colour on solid media. The pigment is so strong that it might give a green tinge to the sputum sample. P. aeruginosa produces indophenol oxidase, an enzyme that renders them positive in the “oxidase” test, distinguishing them from other gram-negative bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Colony morphology is a method scientists use to describe the characteristics of an individual colony of bacteria growing on agar in a Petri dish. It can be used to help to identify them. An organism grown on agar shows green-coloured colonies; the likely organism is:", "options": [{"label": "A", "text": "Staphylococcus", "correct": false}, {"label": "B", "text": "E. Coli", "correct": false}, {"label": "C", "text": "Pseudomonas", "correct": true}, {"label": "D", "text": "Peptostreptococcus", "correct": false}], "correct_answer": "C. Pseudomonas", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas Pseudomonas aeruginosa is one of the most common organisms. It produces soluble pigments like pyocyanin (blue), pyoverdine (yellow-green), pyorubin (red) and pyomelanin (brown) Staphylococcus aureus produces a non-soluble golden yellow pigment. E. coli produces no distinct pigment PEPTOSTREPTOCOCCUS IS AN ANAEROBE.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Colony morphology is a method scientists use to describe the characteristics of an individual colony of bacteria growing on agar in a Petri dish. It can be used to help to identify them. Which bacteria acts by inhibiting protein synthesis:", "options": [{"label": "A", "text": "Pseudomonas", "correct": true}, {"label": "B", "text": "Staphylococcus", "correct": false}, {"label": "C", "text": "Streptococcus", "correct": false}, {"label": "D", "text": "Klebsiella", "correct": false}], "correct_answer": "A. Pseudomonas", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas Among the organisms that produce toxins that specifically inhibit protein synthesis are two pathogenic bacteria, Corynebacterium diphtheria and Pseudomonas aeruginosa. The factor is thereby inactivated, and protein synthesis is inhibited. Pseudomonas aeruginosa toxin (PA toxin) inhibits protein synthesis. A protein synthesis inhibitor is a substance that stops or slows the growth or proliferation of cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A severely burned firefighter develops a rapidly disseminating bacterial infection while hospitalised. \"Green pus\" is noted in the burned tissue, and cultures of both the tissue and blood yield small oxidase-positive gram-negative rods. Which of the following statements most accurately conveys information about this organism?", "options": [{"label": "A", "text": "Endotoxin is the only virulence factor known to be produced by these bacteria.", "correct": false}, {"label": "B", "text": "Humans are the only known reservoir hosts for these bacteria.", "correct": false}, {"label": "C", "text": "The bacteria are difficult to culture because they have numerous growth requirements.", "correct": false}, {"label": "D", "text": "These are among the most antibiotic-resistant of all clinically relevant bacteria.", "correct": true}], "correct_answer": "D. These are among the most antibiotic-resistant of all clinically relevant bacteria.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>These are among the most antibiotic-resistant of all clinically relevant bacteria. The organism discussed in the question– post-burn injury with green pus is Pseudomonas aeruginosa</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B and C. It is a highly virulent organism with many factors responsible for virulence and drug resistance. It commonly contaminates hospital surfaces, water supplies, etc. It is an easily cultivable bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The fluoroquinolone resistance seen with increasing frequency in Pseudomonas aeruginosa infections is best explained by which of the following mechanisms?", "options": [{"label": "A", "text": "Changes in the structure or composition of the cell envelope that make it more difficult for the antibiotic to gain entrance", "correct": false}, {"label": "B", "text": "Enzymatic cleavage of the antibiotic molecule", "correct": false}, {"label": "C", "text": "Inactivation of the antibiotic by enzymatic acetylation", "correct": false}, {"label": "D", "text": "Removal of the antibiotic from the cell interior by a membrane pump", "correct": true}], "correct_answer": "D. Removal of the antibiotic from the cell interior by a membrane pump", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Removal of the antibiotic from the cell interior by a membrane pump The most common resistance mechanism in pseudomonas is efflux pumps/ membrane pumps. Treatment of P. aeruginosa infections has become a significant challenge due to increased resistance to aminoglycoside, β-lactam and fluoroquinolone. The intrinsic antibiotic resistance mechanisms possessed by aeruginosa include restricted outer-membrane permeability, efflux systems that pump antibiotics out of the cells and the production of antibiotic-inactivating enzymes. Quinolones and β-lactams penetrate cell membranes through porin channels (OprD)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following statements are true about Pseudomonas except:", "options": [{"label": "A", "text": "Facultative anaerobe", "correct": true}, {"label": "B", "text": "Resistant to common antiseptics", "correct": false}, {"label": "C", "text": "Commonest cause of infection in bums", "correct": false}, {"label": "D", "text": "Non sporing, gram negative bacilli", "correct": false}], "correct_answer": "A. Facultative anaerobe", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Facultative anaerobe Pseudomonas aeruginosa had been considered an obligately aerobic bacterium . p. aeruginosa is a Gram-negative, aerobic (and at times facultatively anaerobic) rod-shaped bacterium with unipolar motility. It has been identified as an opportunistic pathogen of both humans and plants. Pseudomonas aeruginosa has been shown to possess high intrinsic resistance to most antibiotics through restricted outer membrane permeability. These efflux systems pump antibiotics out of the cell and production of antibiotic-inactivating enzymes such as β-lactamases.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Resistant to common antiseptics - True, can grow in cetrimide Option C. Commonest cause of infection in bums. - True. Option D. Non-sporing, gram-negative bacilli - True</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Each of the following statements concerning Bacteroides fragilis is correct except:", "options": [{"label": "A", "text": "Bacteroides fragilis is a gram-negative rod that is a normal part of the flora of the colon", "correct": false}, {"label": "B", "text": "Forms endospores which allow it to survive in the soil", "correct": true}, {"label": "C", "text": "Its capsule is an important virulence factor", "correct": false}, {"label": "D", "text": "Infections caused by it are characterised by foul-smelling pus", "correct": false}], "correct_answer": "B. Forms endospores which allow it to survive in the soil", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Forms endospores which allow it to survive in the soil Fragilis is an obligate anaerobe gram-negative rod with its capsule as a virulence factor. Anaerobic infections are often a collection of foul-smelling pus.</p>\n<p><strong>Highyeild:</strong></p><p>Virulence factors of Bacteroides spp. Include: Capsular polysaccharide — inhibits opsonization/ phagocytosis, promotes abscess formation, and promotes adherence to epithelial cells; Pili and fimbriae — promote adherence to epithelial cells and mucus; succinic acid — inhibits phagocytosis and intracellular killing; Enzyme production — contribute to tissue damage and/ or promote invasion and spread, e.g. heparinase, fibrinolysin, hyaluronidase, neuraminidase; Synergy between anaerobic and facultative bacteria Synergy in anaerobic infections Infections involving anaerobes usually contain multiple anaerobic bacteria, as well as facultative anaerobic bacteria. True synergy between anaerobic and facultative bacteria, with the formation of abscesses occurs more readily with infections involving both groups of bacteria than alone. Facultative organisms may lower the oxidation– reduction potential in the microenvironment, promoting more favorable conditions for anaerobes. Anaerobic bacteria may inhibit the phagocytosis of facultative bacteria. B. fragilis produces β- lactamases in abscess fluid that may protect other normally susceptible bacteria from antimicrobials.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is cultivable on cell-free medium?", "options": [{"label": "A", "text": "Pneumocystis jiroveci", "correct": false}, {"label": "B", "text": "Rhinosporidium seeberi", "correct": false}, {"label": "C", "text": "Mycoplasma", "correct": true}, {"label": "D", "text": "Treponema pallidum", "correct": false}], "correct_answer": "C. Mycoplasma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mycoplasma Mycoplasma is a genus of bacteria that lack a cell wall around their cell membranes. This characteristic makes them naturally resistant to antibiotics that target cell wall synthesis (like the beta-lactam antibiotics). They can be parasitic or saprotrophic. Mycoplasma infection is a respiratory illness caused by Mycoplasma pneumoniae, a microscopic organism related to bacteria. Mycoplasmas are surface parasites of the human respiratory and urogenital tracts. Mycoplasma pneumoniae attaches to sialoglycoproteins or sialoglycolipid receptors on the tracheal epithelium via protein adhesins on the attachment organelle.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B and D. Are non-cultivable</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following best describes L. monocytogenes?", "options": [{"label": "A", "text": "Flagella are produced both at room temperature and at 37 degrees C", "correct": false}, {"label": "B", "text": "Listeria are facultative intracellular pathogens", "correct": true}, {"label": "C", "text": "Listeria cannot be cultivated on artificial media", "correct": false}, {"label": "D", "text": "once infected, the immune system cannot destroy Listeria", "correct": false}], "correct_answer": "B. Listeria are facultative intracellular pathogens", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Listeria are facultative intracellular pathogens Option B. Listeria shows differential tumbling motility at 4 degrees celsius but not at body temp (37 degrees C)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, D. Listeria multiply both extracellularly and intracellularly (more commonly); a competent immune system eliminates Listeria. listeriosis is mostly seen in the very young and the very old, and in people with compromised immune systems. Reports of Listeria food outbreaks have implicated such foods as coleslaw and milk products, especially if not pasteurized. Option C. It is cultivable on blood agar, which is poorly beta-hemolytic.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 56-year-old male with chronic renal failure and uncontrolled diabetes presents with signs and symptoms of pneumonia and ulceration of the trachea. He works as a caretaker in a horse stable in the Middle East. The clinician suspects zoonotic infection due to non-fermenter, non-motile and oxidase-negative gram-negative bacilli. Which of the following is the most probable pathogen?", "options": [{"label": "A", "text": "Burkholderia pseudomallei", "correct": false}, {"label": "B", "text": "Burkholderia mallei", "correct": true}, {"label": "C", "text": "Burkholderia cepacia", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "B. Burkholderia mallei", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Burkholderia mallei mallei is a pathogen of horses, where it causes glanders. Unlike other species, mallei is not an environmental organism. B. mallei causes glanders, a rare disease of horses in Asia, Africa, and the Middle East. It is strictly zoonoti c, transmitted from horses to man either by direct inoculation or inhalation. It is similar to that of pseudomallei. However, mallei differs from B. pseudomallei in being non-motile and oxidase negative.</p>\n<p><strong>Extraedge:</strong></p><p>B. Pseudomallei is usually acquired through inhaling contaminated particles or cutaneously through skin abrasions. It can infect almost any organ. Manifestations range from subclinical infection to pneumonia (may cavitate with profound weight loss, resembling TB), skin ulcers/ abscesses, genital infection and prostatitis, bone and joint infection, encephalomyelitis, or septicaemia. May present years after exposure due to the intracellular nature of the organism. B. cepacia: a nosocomial pathogen. Can cause bacteremia, VAP, necrotising pneumonia etc. Environmental transmission may occur via contact with respiratory equipment, water supplies, or disinfectants. Burkholderia spp. are motile, non- lactose fermenting, aerobic GNRs. B. cepacia complex members show high resistance rates to antipseudomonal antibiotics, including colistimethate sodium. Combination therapy is preferred- Commonly used combinations include meropenem with ceftazidime or tobramycin.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 29 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 12-year-old boy is brought to the emergency department by paramedics after being found unresponsive at home. He had 24 hours of headache, nausea, and fever, and his parents were treated with acetaminophen. His temperature is 39.6 C (103.4 F). Physical examination reveals neck stiffness. Lumbar puncture is performed. Analysis of cerebrospinal fluid shows marked pleocytosis and Gram stain shows gram-negative cocci in pairs. The parents are concerned about their younger son, who shares a bedroom with the patient. Which of the following is the most appropriate management of this patient's household contacts?", "options": [{"label": "A", "text": "Immediate vaccination", "correct": false}, {"label": "B", "text": "Observation only", "correct": false}, {"label": "C", "text": "Prophylactic penicillin", "correct": false}, {"label": "D", "text": "Prophylactic rifampicin", "correct": true}], "correct_answer": "D. Prophylactic rifampicin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Prophylactic rifampicin This patient's presentation and the finding of gram-negative diplococci highly suggest meningitis due to Neisseria meningitidis. N meningitidis is transmitted by direct contact with contaminated respiratory secretions or aerosolized droplets . As a result, people with close or intimate contact (eg, household contacts, kissing contacts, health care workers who directly contacted secretions) are at markedly increased risk of meningococcal infection. Antibiotic chemoprophylaxis can prevent these secondary cases if given promptly. History of meningococcal vaccination does not preclude the need for antibiotic chemoprophylaxis. Of the listed agents, rifampicin is the only effective choice. Rifampicin penetrates well into all body compartments, including the upper respiratory tract, and will eliminate nasopharyngeal colonization. Other effective agents include ciprofloxacin (not routinely used in children due to concerns about connective tissue injury) and intramuscular ceftriaxone , which is effective but not widely used due to the painful mode of administration. Chemoprophylaxis should be given as soon as possible, preferably within 24 hours of diagnosis.</p>\n<p><strong>Highyeild:</strong></p><p>Persons needing antimicrobial prophylaxis following Neisseria meningitidis exposure Household members Roommates or intimate contacts Child care center workers Persons directly exposed to patient's respiratory or oral secretions (eg, kissing, mouth-to-mouth resuscitation, endotracheal intubation/ management) Airline travelers seated next to an affected person for 28 hours</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A : Vaccination is an important public health strategy for the control of meningococcal disease in general, but does not play a role in post-exposure prophylaxis . Immunity following a post-exposure vaccination does not occur in time to prevent disease. Option B : A person's risk for infection is 500-1,000 times greater following exposure to a meningococcal disease patient, and disease onset can be rapid. Therefore, observation alone is not an appropriate strategy for exposed close contacts. Option C : Although penicillin can be used for the treatment of susceptible meningococcal infections , it has not been shown to eliminate nasal carriage or prevent secondary cases. Therefore, it should not be used for chemoprophylaxis.</p>\n<p><strong>Extraedge:</strong></p><p>N. meningitidis is spread through saliva and respiratory secretions during coughing, sneezing, kissing, chewing on toys and through sharing a source of fresh water. It has also been reported to be transmitted through oral sex and cause urethritis in men.[3] It infects its host cells by sticking to them with long thin extensions called pili and the surface-exposed proteins Opa and Opc and has several virulence factors.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A baby born at 32 weeks gestation with Apgar scores of 2 and 7 was placed in the neonatal intensive care unit. She developed a fever and leukocytosis; lumbar puncture revealed pleocytosis with increased protein, decreased glucose, and gram-positive rods. Which one of the following organisms was most likely isolated from the CSF (Cerebro-Spinal Fluid)?", "options": [{"label": "A", "text": "Escherichia coli", "correct": false}, {"label": "B", "text": "Listeria monocytogenes", "correct": true}, {"label": "C", "text": "Neisseria meningitidis", "correct": false}, {"label": "D", "text": "Streptococcus agalactiae", "correct": false}], "correct_answer": "B. Listeria monocytogenes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Listeria monocytogenes Diagnosis- Meningitis It can grow in refrigerated food and can tolerate preserving agents. Mode of transmission: Contaminated food (raw milk, MC) followed by vertical transmission (mother to fetus).</p>\n<p><strong>Highyeild:</strong></p><p>Intracellular survival: It is a facultative intracellular Survival inside the host cells is due to inhibition and lysis of phagosome by forming pores (mediated by listeriolysin O). Direct cell-to-cell spread is due to host cell actin polymerization (mediated by listeriopods).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. E.coli is a gram-negative, facultative, anaerobic, rod-shaped, coliform bacterium Option C . meningitidis is one of the major causes of meningitis in children and adolescents but is very rarely seen in neonates. Also, it is a gram-negative bacterium . Option D. In neonates S. agalactiae manifests as fever, difficulty breathing, irritability or lethargy (limpness or hard to wake up the baby), difficulty breathing, and blueish colour to the skin.</p>\n<p><strong>Extraedge:</strong></p><p>Septicaemia caused by Neisseria meningitidis has received much less public attention than meningococcal meningitis even though septicaemia has been linked to infant deaths.[6] Meningococcal septicaemia typically causes a purpuric rash, that does not lose its color when pressed with a glass slide (\"non-blanching\") and does not cause the classical symptoms of meningitis. This means the condition may be ignored by those not aware of the significance of the rash. Septicaemia carries an approximate 50% mortality rate over a few hours from initial onset.[citation needed] Other severe complications include Waterhouse–Friderichsen syndrome, a massive, usually bilateral, hemorrhage into the adrenal glands caused by fulminant meningococcemia, adrenal insufficiency, and disseminated intravascular coagulation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Listeria monocytogenes is frequently a foodborne pathogen because:", "options": [{"label": "A", "text": "It can survive at 4 C", "correct": false}, {"label": "B", "text": "Survives under conditions of low pH.", "correct": false}, {"label": "C", "text": "Survives in the presence of high salt concentration", "correct": false}, {"label": "D", "text": "All of the above.", "correct": true}], "correct_answer": "D. All of the above.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above. Listeria monocytogenes is the species of pathogenic bacteria that causes the infection listeriosis. It is a facultative anaerobic bacterium, capable of surviving in the presence or absence of oxygen.</p>\n<p><strong>Highyeild:</strong></p><p>The Gram-positive bacterium Listeria monocytogenes is a facultative intracellular parasite that invades and multiplies within diverse eukaryotic cell types. An essential pathogenicity determinant is its ability to move in the host cell cytoplasm and to spread within tissues by directly passing from one cell to another. Options A, B & C: Monocytogenes in osmotic stress and low pH are largely influenced by temperature. The low temperature (4°C), in which the rate of growth and metabolism of the bacteria is reduced, allows the bacteria to survive more at lower pH and high salt concentration than the high temperature (20°C).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Self-explanatory. All the options are correct.</p>\n<p><strong>Extraedge:</strong></p><p>Listeria monocytogenes is the species of pathogenic bacteria that causes the infection listeriosis. It is a facultative anaerobic bacterium, capable of surviving in the presence or absence of oxygen.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cerebrospinal fluid from a spinal tap of a patient complaining of a severe headache, fever, and nuchal rigidity revealed the presence of gram-negative coccobacilli. Further testing revealed growth of the organism on growth factor X and V supplemented chocolate agar, and no hemolysis when grown on blood agar. Which of the following organisms represents the above description?", "options": [{"label": "A", "text": "Bordetella pertussis", "correct": false}, {"label": "B", "text": "Haemophilus ducreyi", "correct": false}, {"label": "C", "text": "Haemophilus hemolyticus", "correct": false}, {"label": "D", "text": "Haemophilus influenzae", "correct": true}], "correct_answer": "D. Haemophilus influenzae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Haemophilus influenzae Diagnosis- Meningitis Haemophilus influenzae requires both factors X and V; accordingly, it grows on chocolate agar but not on blood agar , although it may appear on a blood agar plate as tiny satellite colonies around the colonies of other bacteria that have lysed red blood cells.</p>\n<p><strong>Highyeild:</strong></p><p>Growth occurs in CAP Community-acquired pneumonia because NAD Nicotinamide adenine dinucleotide is released from the blood during the heating process of chocolate agar preparation the heating process also inactivates growth inhibitors and hemin is available from non-hemolyzed as well as hemolyzed blood cells. Alternatively, NAD can be included as a component of liquid Hydrogen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. B. pertussis causes whooping cough symptoms are paroxysms of violent coughs, vomiting and exhaustion Option B. H. ducreyi causes the STD Chancroid which does not manifest as nuchal rigidity Option C. H. hemolyticus is a gram-negative bacteria it is generally non-pathogenic.</p>\n<p><strong>Extraedge:</strong></p><p>Influenzae (culture) Chocolate agar : H. influenzae strains produce mucoid colonies on chocolate agar. Convex and smooth grey or transparent colonies. H. influenzae grows well on chocolate agar because it contains both X and V factor s.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about H. Influenzae except:", "options": [{"label": "A", "text": "Exhibits satellitism", "correct": false}, {"label": "B", "text": "Typing is by Quellung reaction", "correct": false}, {"label": "C", "text": "Causes epiglottitis", "correct": false}, {"label": "D", "text": "Factor X is NAD", "correct": true}], "correct_answer": "D. Factor X is NAD", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Factor X is NAD Factor X- hemin present freely in the blood. Factor V is a NAD (present in side RBC)</p>\n<p><strong>Highyeild:</strong></p><p>Haemophilus influenzae (formerly called Pfeiffer's bacillus or Bacillus influenzae) is a Gram-negative, non-motile, coccobacillary, facultatively anaerobic, capnophilic pathogenic bacterium of the family Pasteurellaceae. The bacteria are mesophilic and grow best at temperatures between 35 and 37°C</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The Quellung reaction , also called the Neufeld reaction, is a biochemical reaction in which antibodies bind to the bacterial capsule of Streptococcus pneumoniae, Klebsiella pneumoniae, Neisseria meningitidis, Bacillus anthracis, Haemophilus influenzae. Option B. Epiglottitis is usually caused by the bacteria Haemophilus influenzae. Option C. Satellitism test designed to facilitate the isolation and identification of Haemophilus influenzae and Haemophilus parainfluenzae is described.</p>\n<p><strong>Extraedge:</strong></p><p>Influenzae (culture) Chocolate agar : H. influenzae strains produce mucoid colonies on chocolate agar. Convex and smooth grey or transparent colonies. H. influenzae grows well on chocolate agar because it contains both X and V factor s.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An inhibitor was designed to block a biological function in H. influenzae. If the goal of the experiment was to reduce the virulence of H. influenzae, the most likely target would be which of the following?", "options": [{"label": "A", "text": "Capsule formation", "correct": true}, {"label": "B", "text": "Endotoxin assembly", "correct": false}, {"label": "C", "text": "Exotoxin liberator", "correct": false}, {"label": "D", "text": "Flagella synthesis", "correct": false}], "correct_answer": "A. Capsule formation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Capsule formation The poly ribosyl ribitol phosphate (PRP) capsule is the most important virulence factor because it renders type b H. influenzae resistant to phagocytosis by polymorphonuclear leukocytes in the absence of specific anti-capsular antibody, and it reduces the bacterium’s susceptibility to the bactericidal effect of serum.</p>\n<p><strong>Highyeild:</strong></p><p>Haemophilus influenzae is a small gram-negative coccobacillus known as one of the major causes of meningitis, otitis media, sinusitis and epiglottitis. The capsular antigen of type b is a poly ribosyl ribitol phosphate ( PRP). The capsule is antiphagocytic and one of the major virulence factors of H.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is true of Haemophilus influenzae?", "options": [{"label": "A", "text": "Most invasive infections occur during the neonatal period", "correct": false}, {"label": "B", "text": "Invasive infections are most commonly associated with encapsulated strains", "correct": true}, {"label": "C", "text": "Most human infections are acquired from domestic pets", "correct": false}, {"label": "D", "text": "The organism can be readily cultured on sheep blood agar in an environment of elevated CO2", "correct": false}], "correct_answer": "B. Invasive infections are most commonly associated with encapsulated strains", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Invasive infections are most commonly associated with encapsulated strains Age is an important risk factor for invasive Hib infections, and children younger than five years of age are at the highest risk of Hib disease in unimmunized populations. Two-thirds of cases occur in children younger than two years of age and the peak incidence is at 10–12 months. Encapsulated strains of Haemophilus influenzae isolated from cerebrospinal fluid. Invasive H influenzae disease includes the following: Gram staining of body fluids from various sites of infection and Nasopharyngeal colonization of encapsulated H influenzae.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Neonates and Infants younger than 3 months have some antibodies against H. influenzae but as they grow they start losing these antibodies that’s why before the development of H. influenzae B conjugate vaccine it was the major reason for bacterial meningitis in children from 5 months to 5 years of age in the USA in 1990. Option C. Most human infections of HIB are caused by humans themselves as it is spread through respiratory droplets of one infected person to another. Option D . The organism does not grow on sheep blood agar except around colonies of staphylococci (“satellite phenomenon”). It is readily cultured on chocolate agar, the growth is enhanced by IsoVitaleX.</p>\n<p><strong>Extraedge:</strong></p><p>H. Influenzae is a small Gram-negative bacterium, approximately 0.3 micrometer to 1 micrometer.[16] Like other Gram-negative bacteria, H. influenzae has a thin peptidoglycan layer surrounded by an outer membrane containing lipopolysaccharide.[17] Some types of H. influenzae contain a polysaccharide capsule around the outer membrane to aid in protection and colonization.[18] The bacteria are pleomorphic, meaning the shape of the bacterium is variable, however it is typically coccobacillus or rod-shaped.[19] H. Influenzae contains pili, which are specialized to adhere to the human nasopharynx.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about H. influenza includes the following except:", "options": [{"label": "A", "text": "Needs factors X and V for growth", "correct": false}, {"label": "B", "text": "The protein capsule is its main virulence factor", "correct": true}, {"label": "C", "text": "The most common invasive manifestation caused is meningitis", "correct": false}, {"label": "D", "text": "Rare below two months of age", "correct": false}], "correct_answer": "B. The protein capsule is its main virulence factor", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The protein capsule is its main virulence factor The poly ribosyl ribitol phosphate (PRP) capsule is the most important virulence factor because it renders type b H. influenzae resistant to phagocytosis by polymorphonuclear leukocytes in the absence of specific anti-capsular antibody, and it reduces the bacterium’s susceptibility to the bactericidal effect of serum. Haemophilus influenzae is a small gram-negative coccobacillus known as one of the major causes of meningitis, otitis media, sinusitis and epiglottitis. The capsular antigen of type b is a poly ribosyl ribitol phosphate (PRP). The capsule is antiphagocytic and one of the major virulence factors of H.</p>\n<p><strong>Highyeild:</strong></p><p>Characteristics Pleomorphic (tiny) Gram negative rod Non motile Non spore forming Fastidious Generally aerobic Requires both X and V factor Capnophilic (CO2) Encapsulated vs. Non-encapsulated Outermost structure (polysaccharide capsule)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Identification of organisms of the Haemophilus group requires certain growth factors called X and V. Factor X acts physiologically as hemin, and factor V can be replaced by nicotinamide adenine nucleotide (NAD). Option C. In the case of an unvaccinated person meningitis is the most common invasive manifestation of Hib. Option D. Antibodies are present in neonates and infants below the age of 3 months, antibodies decrease as the age increases.</p>\n<p><strong>Extraedge:</strong></p><p>Capsule of Hemophilus Influenza.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 18-month-old baby girl is suspected to have Haemophilus influenzae meningitis. She has not been immunized with the HIB vaccine. A rapid latex agglutination test is performed with the spinal fluid to make a definitive diagnosis. What chemical component in the spinal fluid are we detecting with this assay?", "options": [{"label": "A", "text": "IgG antibody", "correct": false}, {"label": "B", "text": "IgM antibody", "correct": false}, {"label": "C", "text": "Lipopolysaccharide (LPS)", "correct": false}, {"label": "D", "text": "Polysaccharide capsule", "correct": true}], "correct_answer": "D. Polysaccharide capsule", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polysaccharide capsule The poly ribosyl ribitol phosphate (PRP) capsule is the most important virulence factor because it renders type b H. influenzae resistant to phagocytosis by polymorphonuclear leukocytes in the absence of specific anti-capsular antibody, and it reduces the bacterium’s susceptibility to the bactericidal effect of serum. Haemophilus influenzae is a small gram-negative coccobacillus known as one of the major causes of meningitis, otitis media, sinusitis and epiglottitis. The capsular antigen of type b is a poly ribosyl ribitol phosphate (PRP). The capsule is antiphagocytic and one of the major virulence factors of Hemophilus influenzae.</p>\n<p><strong>Highyeild:</strong></p><p>Characteristics Pleomorphic (tiny) Gram negative rod Non motile Non spore forming Fastidious Generally aerobic Requires both X and V factor Capnophilic (CO2) Encapsulated vs. Non-encapsulated Outermost structure (polysaccharide capsule)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. These are not used for definitive diagnosis in H. influenzae whereas the polysaccharide capsule is definitive as it is the most important virulence factor of H. influenzae</p>\n<p><strong>Extraedge:</strong></p><p>Capsule of Hemophilus Influenza</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old boy is brought to the emergency room in extreme respiratory distress, with a temperature of 103.8 degrees Fahrenheit. He is drooling and has difficulty swallowing, and on physical examination, inspiratory stridor is noted. A lateral x-ray shows swelling of the epiglottis. He has had no previous vaccinations. Which of the following agents is the most likely cause of these symptoms?", "options": [{"label": "A", "text": "Haemophilus influenza", "correct": true}, {"label": "B", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "C", "text": "Legionella pneumophila", "correct": false}, {"label": "D", "text": "Streptococcus pyogenes", "correct": false}], "correct_answer": "A. Haemophilus influenza", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Haemophilus influenza The most common cause of epiglottitis in children in the past was infection with Haemophilus influenzae type b.</p>\n<p><strong>Highyeild:</strong></p><p>The most common strain of bacteria that causes this condition is Haemophilus influenzae type b, also known as Hib. Haemophilus influenzae serotype b (Hib) was a major cause of childhood. Recent cases of invasive. H. influenzae disease causing epiglottitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B . Klebsiella pneumoniae is a Gram-negative, non-motile, encapsulated, lactose-fermenting facultative anaerobic, rod-shaped bacterium. It appears as a mucoid lactose fermenter on MacConkey agar. Individuals with Klebsiella pneumonia tend to cough up a characteristic sputum, as well as have fever, nausea, tachycardia, and vomiting. Klebsiella pneumonia tends to affect people with underlying conditions, such as alcoholism . Option C. Legionella pneumophila is a thin, aerobic, pleomorphic, flagellated, non-spore-forming, Gram-negative bacterium of the genus Legionella. L. pneumophila is the primary human pathogenic bacterium in this group and is the causative agent of Legionnaires' disease, also known as legionellosis. Option D . Infections due to certain strains of S. pyogenes can be associated with the release of bacterial toxins . Throat infections associated with the release of certain toxins lead to scarlet fever. Other toxigenic S. pyogenes infections may lead to streptococcal toxic shock syndrome, which can be life-threatening.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "For prophylaxis of H. Influenza meningitis, the drug used is:", "options": [{"label": "A", "text": "Rifampicin", "correct": true}, {"label": "B", "text": "Ampicillin", "correct": false}, {"label": "C", "text": "Benzyl penicillin", "correct": false}, {"label": "D", "text": "Ceftriaxone", "correct": false}], "correct_answer": "A. Rifampicin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rifampicin Rifampicin is used for prophylaxis for throat carriage of Haemophilus influenzae type b. Haemophilus influenzae type B meningitis: a contagious disease of children. Rifampin eradicates the organism from the pharynx by approximately 95%. Prevention and control of meningococcal disease: recommendation . Effect of rifampin on chloramphenicol levels. Haemophilus influenzae serotype b (Hib) can cause severe life-threatening so the drug used is rifampicin chemoprophylaxis</p>\n<p><strong>Highyeild:</strong></p><p>Uses of Rifampicin Therapeutic uses Treatment of TB in combination with INH and pyrazinamide. Although rifampin has activity against many Gram positive and negative bacteria but should be used only against TB to prevent development of resistance. Treatment of leprosy in combination of dapsone and clofazemine. Prophylactic for individuals exposed to meningitis caused by Meningococci or H. influenzae</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B & C. beta-lactamase-producing strains are resistant to Ampicillin/Penicillin. Option D: Ceftriaxone is not used for mass prophylaxsis.</p>\n<p><strong>Extraedge:</strong></p><p>Rifampin (Rifampicin) Therapeutic uses Treatment of TB in combination with INH and pyrazinamide. Although rifampin has activity against many Gram positive and negative bacteria but should be used only against TB to prevent development of resistance. Treatment of leprosy in combination of dapsone and clofazemine. Prophylactic for individuals exposed to meningitis caused by Meningococci or H. influenzae</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The most common agent associated with neonatal bacterial meningitis is:", "options": [{"label": "A", "text": "Streptococcus agalactiae", "correct": true}, {"label": "B", "text": "Streptococcus pneumoniae", "correct": false}, {"label": "C", "text": "Listeria monocytogenes", "correct": false}, {"label": "D", "text": "H. influenzae", "correct": false}], "correct_answer": "A. Streptococcus agalactiae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus agalactiae Group B Streptococcus (Streptococcus agalactiae). These are beta-hemolytic, bacitracin resistant, (Christie–Atkins–Munch-Peterson) CAMP test positive, and they are a prime cause of puerperal sepsis and neonatal meningitis. S. agalactiae is the species designation for the only species of streptococci belonging to group B of the Rebecca Lancefield classification of streptococci. S agalactiae is best known as a cause of postpartum infection and as the most common cause of neonatal sepsis.</p>\n<p><strong>Highyeild:</strong></p><p>What are the most Common Organisms that cause Bacterial Meningitis in Neonates? Group B Streptococcus (30 – 40%) Gram-negative enteric bacilli (30 – 40%) Escherichia coli, Klebsiella, Enterobacter, Salmonella, Serratia marcesans, Citrobacter, and Proteus mirabilis Listeria monocytogenes (10%) Others include Staphylococcus aureus, viridans streptococci, and coagulase-negative staphylococci</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. S. pneumoiae meninigitis is very rarely reported in neonates so far. Option C. L. monocytogenes is also not as common and is a food-borne pathogen with a high chance of infecting neonates, pregnant women, the elderly and immunocompromised It can cause neonatal meningitis and sepsis with a high risk of severe neurological and developmental sequelae and high mortality rates. Option D. influenzae is not generally seen on neonates as antibodies are present, provided from the mother up to the age of 3 months.</p>\n<p><strong>Extraedge:</strong></p><p>What are the most Common Organisms that cause Bacterial Meningitis in Neonates? Group B Streptococcus (30-40 %) Gram-negative enteric bacilli (30 – 40%) Escherichia coli, Klebsiella, Enterobacter, Salmonella, Serratia marcesans, Citrobacter, and Proteus mirabilis Listeria monocytogenes (10%) Others include Staphylococcus aureus, streptococci, and coagulase-negative staphylococci</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 3-year-old is diagnosed with bacterial meningitis. Cerebrospinal fluid grows out of gram-positive cocci in short chains and diplococci. This is most likely to be which of the following?", "options": [{"label": "A", "text": "Group B Streptococci", "correct": false}, {"label": "B", "text": "Salmonella", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Streptococcus pneumoniae", "correct": true}], "correct_answer": "D. Streptococcus pneumoniae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus pneumoniae Diagnosis- Pneumococcal Meningitis. Pneumococcal meningitis is caused by Streptococcus pneumoniae bacteria (also called pneumococcus, or S pneumoniae ).</p>\n<p><strong>Highyeild:</strong></p><p>This type of bacteria is the most common cause of bacterial meningitis in adults. It is the second most common cause of meningitis in children older than age 2. Pneumococcal meningitis can occur when the Streptococcus pneumonia bacteria invade the bloodstream, cross the blood-brain barrier and multiply within the fluid surrounding the spine and brain.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Streptococcus agalactiae (also known as group B streptococcus or GBS) is a gram-positive coccus (round bacterium) with a tendency to form chains (as reflected by the genus name Streptococcus). It is a beta-hemolytic, catalase-negative, and facultative anaerobe Option B. Salmonella group organisms do not form chains and are not diplococci Option C. S. aureus is a gram-positive spherically shaped bacterium. It is non-motile and does not form spores.</p>\n<p><strong>Extraedge:</strong></p><p>Streptococcus pneumoniae, or pneumococcus, is a Gram-positive, spherical bacteria, alpha-hemolytic member of the genus Streptococcus. They are usually found in pairs and do not form spores and are non motile . Streptococcus Pneumonia</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not true about Streptococcus pneumoniae?", "options": [{"label": "A", "text": "Its capsule aids in infectivity.", "correct": false}, {"label": "B", "text": "It is the commonest cause of otitis media and pneumonia.", "correct": false}, {"label": "C", "text": "It is the least likely cause of meningitis.", "correct": true}, {"label": "D", "text": "It is bile soluble", "correct": false}], "correct_answer": "C. It is the least likely cause of meningitis.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It is the least likely cause of meningitis. Pneumococcal meningitis is caused by Streptococcus pneumoniae bacteria (also called pneumococcus, or S pneumoniae). It is M/C/C of meningitis in Adults and 2nd M/C/C of meningitis in children older than 2 yrs.</p>\n<p><strong>Highyeild:</strong></p><p>The polysaccharide capsule is probably the most important virulence factor of the pneumococcus. The role of the capsule in virulence stems from its antiphagocytic activity. Acute otitis media (AOM) is a common childhood infection, caused mainly by Streptococcus pneumoniae. It is also the commonest cause of bacterial pneumonia. S. pneumoniae is bile soluble whereas all other alpha-hemolytic streptococci are bile resistant.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The capsule of the S. pneumoniae prevents or delays ingestion by phagocytes hence is the reason for the virulence of the bacteria Option B. S.pneumoniae commonly causes otitis media and pneumoniae Option D. S. pneumoniae is bile soluble whereas all other alpha-hemolytic streptococci are bile resistant. Sodium deoxycholate (2% water) will lyse the pneumococcal wall</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Two girls in the same class are diagnosed with meningococcal meningitis. Their 12- year old close friend is at risk of contracting the disease. What advice should be given?", "options": [{"label": "A", "text": "2 doses of the polysaccharide vaccine", "correct": false}, {"label": "B", "text": "2 doses of conjugate vaccine", "correct": true}, {"label": "C", "text": "A single dose of meningococcal vaccine", "correct": false}, {"label": "D", "text": "No vaccine is needed as exposure has already occurred", "correct": false}], "correct_answer": "B. 2 doses of conjugate vaccine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>2 doses of conjugate vaccine The meningococcal conjugate vaccine is very effective at protecting against four strains of the bacteria. The meningococcal conjugate vaccine protects against four types of meningococcal bacteria called types A, C, W, and Y. It is recommended for all kids. The meningococcal B vaccine (MenB) protects against a fifth type of meningococcal bacterium (called type B).</p>\n<p><strong>Extraedge:</strong></p><p>Meningococcal disease refers to any illness caused by bacteria called Neisseria meningitidis. These illnesses are often severe, can be deadly, and include infections of the lining of the brain and spinal cord (meningitis) and bloodstream.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A child develops septic shock following meningitis. On exam, the child has a petechial rash as shown in the image. Which of the following is a gram-negative diplococcus that can be the likely etiology.", "options": [{"label": "A", "text": "Pseudomonas aeruginosa", "correct": false}, {"label": "B", "text": "Neisseria meningitides", "correct": true}, {"label": "C", "text": "Strep pneumonia", "correct": false}, {"label": "D", "text": "E.coli", "correct": false}], "correct_answer": "B. Neisseria meningitides", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504669019-QTDV010020IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neisseria meningitides Neisseria meningitidis, often referred to as meningococcus , is a Gram-negative diplococci bacterium that can cause meningitis and other forms of meningococcal disease such as meningococcemia, and life-threatening sepsis.</p>\n<p><strong>Highyeild:</strong></p><p>Septic shock caused by Neisseria meningitidis infection, defined as Waterhouse-Friderichsen syndrome has a high mortality rate of between 21% and 44%. Neisseria meningitidis cause a fulminating fatal infection, frequently with few or no signs or pre-conditions.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - Places where infection occurs -- and their signs -- may include: Ears: pain and discharge Skin: rash, which can include pimples filled with pus Eyes: pain, redness, swelling Bones or joints: joint pain and swelling; neck or back pain that lasts weeks Wounds: green pus or discharge that may have a fruity smell Digestive tract: headache, diarrhoea Lungs: pneumonia; severe coughing and congestion Urinary: urinary tract infections Option C - Symptoms generally include an abrupt onset of fever and chills or rigours. Typically, there is a single rigour and repeated shaking chills are uncommon. Other common symptoms include Pleuritic chest pain Cough productive of mucopurulent Rusty sputum Dyspnea Tachypnea or tachycardia Hypoxia Malaise or weakness Option D - Signs and symptoms of E. coli O157:H7 infection usually begin three or four days after exposure to the bacteria. But you may become ill as soon as one day after exposure to it more than a week later. Signs and symptoms include: Diarrhoea, which may range from mild and watery to severe and bloody Stomach cramping, pain or tenderness Nausea and vomiting, in some people</p>\n<p><strong>Extraedge:</strong></p><p>Waterhouse-Friderichsen Syndrome Neisseria meningitidis sepsis Septic Shock and bleeding into adrenal gland Petechial skin lesions (bleeding into skin) Death within 12 - 48 hours</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Gene responsible for semi-synthetic penicillin resistance in MRSA Methicillin-resistant Staphylococcus aureus?", "options": [{"label": "A", "text": "Mec A", "correct": true}, {"label": "B", "text": "Mec B", "correct": false}, {"label": "C", "text": "Mec D", "correct": false}, {"label": "D", "text": "Mec C", "correct": false}], "correct_answer": "A. Mec A", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mec A Methicillin-resistant Staphylococcus aureus (MRSA) is one of the most important causes of hospital infections worldwide. High-level resistance to methicillin is caused by the mecA gene, which encodes an alternative penicillin-binding protein, PBP 2a.</p>\n<p><strong>Highyeild:</strong></p><p>Mechanism of Resistance of MRSA: Due to chromosomally Bacteriophage mediated Mec A gene acquisition which codes for altered PBP 2a (Penicillin Binding protein or receptor 2a) which has less affinity for β lactam drugs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B – It is a part of a probable primordial form of methicillin resistance gene complex often found in a transposon mec complex in Macrococus caseolyticus, a colonizer of animal skin Option C – Mec C is not responsible in semisynthetic penicillin resistance in MRSA Option D – Mec D has been associated with beta-lactam resistance in S. aureus</p>\n<p><strong>Extraedge:</strong></p><p>Methicillin-resistant Staphylococcus aureus (MRSA) is a cause of staph infection that is difficult to treat because of resistance to some antibiotics. Staph infections—including those caused by MRSA—can spread in hospitals, other healthcare facilities, and in the community where you live, work, and go to school.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Vancomycin is intrinsically resistant in all except?", "options": [{"label": "A", "text": "Enterococcus gallinarum", "correct": false}, {"label": "B", "text": "Leuconostoc", "correct": false}, {"label": "C", "text": "Weissella confusa", "correct": false}, {"label": "D", "text": "Streptococcus agalactiae", "correct": true}], "correct_answer": "D. Streptococcus agalactiae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus agalactiae Streptococcus agalactiae is a gram-positive coccus with a tendency to form chains. It is a beta-hemolytic, catalase-negative, and facultative anaerobe. agalactiae is the species designation for the only species of streptococci belonging to group B of the Rebecca Lancefield classification of streptococci.</p>\n<p><strong>Highyeild:</strong></p><p>S agalactiae i s now best known as a cause of postpartum infection and as the most common cause of neonatal sepsis. The susceptibility testing revealed that 100 per cent of isolates were sensitive to penicillin, ampicillin, vancomycin and high-level gentamicin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. E. Gallinarum are sensitive to penicillin and ampicillin also cephalosporins can be used. It is vancomycin-resistant Option B. Leuconostoc choice of drug is penicillin either alone or in combination with an aminoglycoside. It is vancomycin-resistant Option C. W. confuse is vancomycin-resistant.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Meningitis with rash is seen in.", "options": [{"label": "A", "text": "Neisseria meningitidis", "correct": true}, {"label": "B", "text": "H.influenzae", "correct": false}, {"label": "C", "text": "Streptococcus agalactiae", "correct": false}, {"label": "D", "text": "Pneumococcus", "correct": false}], "correct_answer": "A. Neisseria meningitidis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neisseria meningitidis Hemorrhagic skin lesions/rashes like purpuras and petechiae are seen in meningococcus infections.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenicity: Strict human parasites. Carrier state in the nasopharynx of 5-15% healthy. Dissemination via blood or through the cribriform plate . Capsular serotypes of meningococcus: 13 A, B, C, W135, and Y are important causes of epidemics and outbreaks A: epidemics; C: local outbreaks; B: both; 29E, W 135 & Y: outbreaks High prevalence area-sub-Saharan belt of Africa Outbreaks of meningococcal disease occur more frequently in dry and cold months of the year. Age-early childhood (3 months-5 years) and adolescents. Risk factors-terminal complement component deficiency, hypogammaglobulinemia, hyposplenism Meningitis & septicemia (if fulminant,) called Water house Friedrichsen syndrome) (WF) Waterhouse-Friderichsen syndrome: shock, DIC Disseminated intravascular coagulation, haemorrhages, multisystem failure, adrenal haemorrhage Chronic meningococcemia-rare, repeated episodes of petechial rash, fever, arthritis Pathogenesis of septicaemia: Lipo-oligosaccharide. LOS-mediated damage of vascular endothelium. Also produces IgA1 protease. Polysaccharide capsule is antiphagocytic. T/T: Penicillin G, Chloramphenicol, IIIrd generation cephalosporin; Rifampicin (to prevent carrier state) Chemoprophylaxis- Rifampicin</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C & D : H.influenzae, Streptococcus agalactiae and Pneumococcus can also cause meningitis but usually rash is not seen. Classic petechial rash associated with meningococcal meningitis 6</p>\n<p><strong>Extraedge:</strong></p><p>Neisseria meningitidis, often referred to as meningococcus, is a Gram-negative bacterium that can cause meningitis and other forms of meningococcal disease such as meningococcemia, a life-threatening sepsis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-month-old boy was admitted to an emergency with complaints of high-grade fever, refusal to feed and irrationality. On examination, Kernig’s sign was positive suggestive of the case of Meningitis. Cerebrospinal fluid was collected in a sterile manner and sent for bacteriological examination. Direct microscopy from the CSF shows gram-negative coccobacilli, pleomorphic in nature. The sample was inoculated on blood agar, MacConkey agar and chocolate agar. No growth was observed on Blood agar and MacConkey agar. On chocolate agar, flat greyish and translucent colonies are grown after 24 hours of incubation. Which of the following is the most likely infective agent?", "options": [{"label": "A", "text": "Neisseria meningitidis", "correct": false}, {"label": "B", "text": "Haemophilus influenzae", "correct": true}, {"label": "C", "text": "Escherichia coli", "correct": false}, {"label": "D", "text": "Klebsiella pneumoniae", "correct": false}], "correct_answer": "B. Haemophilus influenzae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Haemophilus influenzae Haemophilus influenzae is gram-negative pleomorphic bacilli. It requires X (hemin) and V (NAD) factors for its growth X and V factor both are present in chocolate agar while in blood agar only X factor is present. That is why it grows well in chocolate agar. To grow in blood agar, Staphylococcus I streaked across media and Satellitism is observed.</p>\n<p><strong>Highyeild:</strong></p><p>Growth on CAP ВАР (Sheep) Gram stain Presumptive identification + + Gram-negative diplococci N. meningitidis + + Gram-positive diplococci S. pneumoniae + - Gram-negative pleomorphic coccobacilli H. influenzae</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Neisseria meningitidis is gram-negative diplococci with adjacent sides flattened and mostly intracellular. It can be grown on both blood agar and chocolate agar Option C: E.coli is a long, slender gram-negative rod that grows well on MacConkey agar and appears as flat moist opaque lactose fermenting colonies. Option D: Klebsiella Are short and stout gram-negative rods grow well on MacConkey agar and appear as dome-shaped mucoid opaque lactose fermenting colonies.</p>\n<p><strong>Extraedge:</strong></p><p>Haemophilus influenzae disease is a name for any illness caused by bacteria called H. influenzae. Some of these illnesses, like ear infections, are mild while others, like bloodstream infections, are very serious. In spite of the name, H. influenzae does not cause influenza (the flu).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 30 old male, presented to a medical emergency with high-grade fever and neck stiffness. The clinician suspected it to be a case of meningitis and performed a test as shown. Choose the incorrect statement.", "options": [{"label": "A", "text": "It is known as the Kernig sign.", "correct": false}, {"label": "B", "text": "Reflex flexion of the patient's hips and knees after passive flexion of the neck constitutes a positive Kernig sign.", "correct": true}, {"label": "C", "text": "It can also be seen in subarachnoid haemorrhage", "correct": false}, {"label": "D", "text": "M/C/C of meningitis in adults is pneumococcal meningitis.", "correct": false}], "correct_answer": "B. Reflex flexion of the patient's hips and knees after passive flexion of the neck constitutes a positive Kernig sign.", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504669515-QTDV010027IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Reflex flexion of the patient's hips and knees after passive flexion of the neck constitutes a positive Kernig sign. It is an incorrect statement as this sign is known as Brudzinski’s sign, not Kernig’s sign. Kernig sign is the appearance of resistance or pain during extension of the patient's knees beyond 135 degrees.</p>\n<p><strong>Highyeild:</strong></p><p>Meningitis is an inflammation (swelling) of the protective membranes covering the brain and spinal cord. A bacterial or viral infection of the fluid surrounding the brain and spinal cord usually causes the swelling. However, injuries, cancer, certain drugs, and other types of infections also can cause meningitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A – Kernig’s Sign - The test for Kernig Sign is done by having the person lie flat on the back, flex the thigh so that it is at a right angle to the trunk, and completely extend the leg at the knee joint. If the leg cannot be completely extended due to pain, this is a Kernig sign. Option C – Kernig’s sign and Brudzinski’s sign can be seen in subarachanoid haemorrhage as the blood irritates the meninges and may cause inflammation</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old male child, presented to a medical emergency with high-grade fever and neck stiffness. The clinician suspected it to be a case of meningitis and performed a lumbar puncture, the CSF specimen showed a cobweb appearance. It is seen in the case of -", "options": [{"label": "A", "text": "Bacterial meningitis", "correct": false}, {"label": "B", "text": "Tubercular meningitis", "correct": true}, {"label": "C", "text": "Viral meningitis", "correct": false}, {"label": "D", "text": "Fungal meningitis", "correct": false}], "correct_answer": "B. Tubercular meningitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tubercular meningitis Cob-web appearance is a characteristic diagnosis feature of tubercular meningitis</p>\n<p><strong>Highyeild:</strong></p><p>Meningitis is usually caused by a viral infection but can also be bacterial or fungal. Vaccines can prevent some forms of meningitis. Symptoms include headache, fever and stiff neck. Depending on the cause, meningitis may get better on its own or it can be life-threatening, requiring urgent antibiotic treatment.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A – Bacterial Meningitis shows a turbid/cloudy appearance Options C & D – Viral & fungal meningitis show a clear appearance</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A sputum sample was brought to the lab for analysis. Gram stain revealed: rare epithelial cells, 20 to 25 polymorphonuclear leukocytes per HPF, and pleomorphic gram-negative rods. Which of the following interpretations should you make?", "options": [{"label": "A", "text": "The appearance of the sputum is suggestive of H. influenzae", "correct": true}, {"label": "B", "text": "The patient has pneumococcal pneumonia", "correct": false}, {"label": "C", "text": "The patient has Vincent’s disease", "correct": false}, {"label": "D", "text": "The sputum specimen is too contaminated by saliva to be useful", "correct": false}], "correct_answer": "A. The appearance of the sputum is suggestive of H. influenzae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The appearance of the sputum is suggestive of H. influenzae Pleomorphic gram-negative rods in a sputum sample most likely suggest H. influenzae infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Pneumococcus is gram-positive Option C. Vincent's disease is acute necrotising ulcerative gingivitis, otherwise known as Vincent's angina or trench mouth, is caused by an imbalance in the normal flora of the gingival sulcus with a predominant presence of the spirochete Borrelia vincentii and the gram-negative Bacillus Fusiformis fusiform. Option D. Sputum described in the ques is appropriate for microbiological analysis.</p>\n<p><strong>Extraedge:</strong></p><p>How To Decide The Quality of The Sputum Sample: Bartlett's criteria: Criteria Score Neutrophils (puscells) count (Score A) < 10 neutrophil/10x field 0 10-25 neutrophils/10x field +1 >25 neutrophils/10x field +2 Macroscopy (Score B) Mucoid, Mucopurelent, Purelent, or Blood stained +1 Squamous epithelial cell count (Score C) < 10 Squamous epithelial cell/10x field 0 10-25 Squamous epithelial cell /10x field -1 >25 Squamous epithelial cell /10x field -2</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are correct “most common causative agent” except:", "options": [{"label": "A", "text": "Common cold - Influenza virus", "correct": true}, {"label": "B", "text": "Weaning diarrhoea - Rotavirus", "correct": false}, {"label": "C", "text": "Encephalitis - Japanese encephalitis", "correct": false}, {"label": "D", "text": "Negri bodies seen in Hippocampus", "correct": false}], "correct_answer": "A. Common cold - Influenza virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Common cold - Influenza virus Although many viruses can cause a common cold, rhinoviruses are the most common culprit. Although rhinoviruses are the most common cause of the common cold, it must be stressed that almost half of the cases are caused by other viruses. There are four types of influenza viruses: A, B, C and D. Human influenza A and B viruses cause seasonal epidemics of disease (known as the flu season). Influenza A viruses are the only viruses known to cause flu pandemics, i.e., global epidemics of flu disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options:- Option B. Weaning diarrhoea - Rotavirus - True Option C. Encephalitis - Japanese encephalitis - True Option D. Negri bodies, seen in Hippocampus - True</p>\n<p><strong>Extraedge:</strong></p><p>Negri Bodies: Negri bodies are the classic histopathologic feature of rabies. Negri bodies as round or oval inclusions within the cytoplasm of nerve cells of animals infected with rabies. Negri bodies may vary in size from 0.25 to 27 µm. They are found most frequently in the pyramidal cells of Ammon's horn and the Purkinje cells of the hippocampus. Options B, C and D. Are the correct matches for most common associated agents.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The source of Neisseria meningitidis is the nasopharynx of human carriers who exhibit no symptoms. The ability of this bacterium to colonise the respiratory mucosa is associated with its ability to synthesise which of the following?", "options": [{"label": "A", "text": "Coagulase", "correct": false}, {"label": "B", "text": "Collagenase", "correct": false}, {"label": "C", "text": "Hyaluronidase", "correct": false}, {"label": "D", "text": "Pili", "correct": true}], "correct_answer": "D. Pili", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pili Neisseria meningitidis , often referred to as meningococcus, is a Gram-negative bacterium that can cause meningitis and other forms of meningococcal diseases, such as meningococcemia and life-threatening sepsis. Meningitidis are gram-negative, coffee-bean-shaped diplococci that may occur intracellularly or extracellularly in PMN Polymorphonuclear leukocytes. Thayer-Martin agar is a Mueller-Hinton agar with 5% chocolate sheep blood and antibiotics. When growing Neisseria meningitidis, one usually starts with a normally sterile body fluid. Meningitidis is mediated by pili, which extend several thousand nm beyond the capsule and initiate binding to epithelial cells.</p>\n<p><strong>Random:</strong></p><p>Explanation for Incorrect options:- Options A, B and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Neisseria meningitidis, often referred to as meningococcus, is a Gram-negative bacterium that can cause meningitis and other meningococcal disease such as meningococcemia. Selective media for meningococcus is:", "options": [{"label": "A", "text": "Blood agar", "correct": false}, {"label": "B", "text": "Deoxycholate citrate media", "correct": false}, {"label": "C", "text": "Thayer-Martin media", "correct": true}, {"label": "D", "text": "McLeod media", "correct": false}], "correct_answer": "C. Thayer-Martin media", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Thayer-Martin media Neisseria meningitidis , often referred to as meningococcus, is a Gram-negative bacterium that can cause meningitis and other forms of meningococcal diseases, such as meningococcemia, a life-threatening sepsis. Meningitidis are gram-negative, diplococci that may occur intracellularly or extracellularly in PMN Polymorphonuclear leukocytes . Thayer-Martin media: for Gonorrhea is a Selective media.</p>\n<p><strong>Highyeild:</strong></p><p>Thayer Martin Agar (Modified) contains hemoglobin, which provides the X factor (hemin), and GCHI Enrichment, which provides the V factor, vitamins, amino acids, coenzymes, and dextrose. Thayer-Martin agar is a Mueller-Hinton agar with 5% chocolate sheep blood and antibiotics. Used specifically for Neisseria spp. Vancomycin, trimethoprim, colistin, and nystatin are selective agents which inhibit gram-positive cocci, gram-negative bacilli and yeast.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Deoxycholate Citrate Agar is prepared as per the modified formula of Leifson. This medium is used for the isolation and maximum recovery of intestinal pathogens belonging to Salmonella and Shigella groups from foods Option D. Tellurite Blood Agar (McLeod Agar) - It is used for the selective isolation and cultivation of Corynebacterium species Option A. It is not the correct option.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 60 yrs elderly male presented with complaints of mild chest pain and cough with expectoration for 15 days. The sputum culture on blood agar yielded gram-positive cocci, mostly in pairs. Which would be the most helpful test to identify the organism?", "options": [{"label": "A", "text": "Bile solubility test", "correct": true}, {"label": "B", "text": "Bacitracin sensitivity", "correct": false}, {"label": "C", "text": "Oxidase positivity", "correct": false}, {"label": "D", "text": "Catalase positivity", "correct": false}], "correct_answer": "A. Bile solubility test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bile solubility test The ques most likely suggests streptococcus pneumonia as a diagnosis causing LRTI. Bile solubility is used to diagnose pneumococcus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Bacitracin Sensitivity is used to detect group A streptococcus which is sensitive to this drug. Option C. Oxidase positive from sputum sample can be Haemophilus influenzae, Moraxella carrthalis, pseudomonas spp. All of these are gram-negative Option D. Catalase positivity is an incorrect option: Pneumococcus is catalase negative bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Waterhouse-Friderichsen syndrome (WFS) is a group of symptoms caused when the adrenal glands fail to function normally. This occurs as a result of bleeding into the glands. Waterhouse Friderichsen syndrome is caused by:", "options": [{"label": "A", "text": "Neisseria gonorrhoeae", "correct": false}, {"label": "B", "text": "Neisseria meningitidis", "correct": true}, {"label": "C", "text": "Chlamydia trachomatis", "correct": false}, {"label": "D", "text": "Lymphogranuloma venereum", "correct": false}], "correct_answer": "B. Neisseria meningitidis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neisseria meningitidis WF syndrome is fulminant meningococcemia characterised by shock, disseminated intravascular coagulation, petechial rash and multisystem failure due to the lipo-oligosaccharide mediated damage of the vascular endothelium.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Watercan perineum is associated with advanced infection of the urethra and adjacent tissues, most commonly gonorrhoea. In the modern era of broad-spectrum antibiotics, urethral fistula (watering can cause perineum) is a forgotten sequelae of chronic gonococcal infection. Option C. Pelvic inflammatory disease (PID) is a sequelae of C. trachomatis. Option D. LGV is an invasive, systemic infection, and if it is not treated early, LGV proctocolitis can lead to chronic colorectal fistulas and strictures</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "An outbreak of diarrheal illness occurs in a community after a massive hurricane. The affected patients experience voluminous, watery diarrhea that quickly leads to severe dehydration. Stool examinations of these patients yield oxidase-positive, curved, highly motile, gram-negative rods. Epidemiologic study reveals the source as a contaminated water supply. Which of the following patient populations would be most susceptible to developing this illness?", "options": [{"label": "A", "text": "Patients lacking a functional spleen", "correct": false}, {"label": "B", "text": "Patients taking proton pump inhibitors", "correct": true}, {"label": "C", "text": "Patients who recently took antibiotics", "correct": false}, {"label": "D", "text": "Patients with chronic liver disease", "correct": false}], "correct_answer": "B. Patients taking proton pump inhibitors", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Patients taking proton pump inhibitors Vibrio cholerae i s a comma-shaped, oxidase-positive, highly motile, gram-negative rod that is acquired after ingesting contaminated food or water . The infection is not invasive and does not disseminate outside of the gastrointestinal tract. However, the elaboration of the cholera enterotoxin leads to severe, watery diarrhea that can cause death from electrolyte imbalance and dehydration within 12 hours of symptom onset. Cholera is endemic in southern Asia, where seasonal outbreaks are common (peaks occur before and after rainy seasons).</p>\n<p><strong>Highyeild:</strong></p><p>The disease is rare and occurs mainly in patients who ingest contaminated seafood from the Gulf Coast. V cholerae must survive the acidic environment of the stomach to reach the small intestine and cause disease. Because the organism is very acid-sensitive, a high burden of V cholerae is generally required to cause clinical symptoms (> 10 10 organisms from contaminated water or > 10 6 organisms from contaminated food). However, those with inadequate gastric acid production (achlorhydria) can develop the disease with much smaller infectious doses as there is insufficient acid to kill the bacteria. Patients on long-term proton pump inhibitor therapy (eg, omeprazole) have pharmacologically induced achlorhydria; it can also be seen in those with gastritis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Patients with splenectomy are at much higher risk of fulminant infection with encapsulated bacteria such as Streptococcus pneumoniae, Neisseria meningitides, and Haemophilus influenzae. V cholerae is not encapsulated and not invasive; patients with splenectomy are unlikely to be at greater risk. Option: C. Recent antibiotic use is a strong risk factor for Clostridium difficile colitis, which typically manifests with watery diarrhea, abdominal pain, and low-grade fever. C difficile is a spore-forming, toxin-producing, gram-positive organism. Option: D. Patients with chronic liver disease are at increased risk for severe disease with Vibrio vulnificus, which can cause watery diarrhea. However, the ingestion of this pathogen usually leads to severe, rapid-onset sepsis in susceptible patients. In addition, V vulnificus is more likely to cause wound infections than gastroenteritis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following toxins acts by increasing cAMP?", "options": [{"label": "A", "text": "Shiga toxin", "correct": false}, {"label": "B", "text": "ETEC Stable toxin", "correct": false}, {"label": "C", "text": "Choleragen", "correct": true}, {"label": "D", "text": "Diphtheria toxin", "correct": false}], "correct_answer": "C. Choleragen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Choleragen Cholera toxin is AB5 multimeric protein complex secreted by the bacterium Vibrio cholerae. CTX is responsible for the massive, watery diarrhea characteristic of cholera infection.</p>\n<p><strong>Highyeild:</strong></p><p>It is a member of the Heat-labile enterotoxin family. Choleragen exerts its effect on cells through the activation of adenylate cyclase. Choleragen initially interacts with cells through binding of the B subunit of the toxin to the ganglioside GM1 on the cell surface. Patching or capping toxins on the cell surface may be an obligatory step in choleragen action.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Shiga toxin is produced by E.coli aka STEC (Shiga toxin-producing E coli). The Shiga toxin inhibits protein synthesis. Option: B. Heat-stable enterotoxins are produced by some bacterial strains such as enterotoxigenic E coli. It activates guanylyl cyclase in enteric epithelial cells and stimulates fluid secretion. Option: D. Diphtheria toxin is a heat-liable, single-chain, three-domain polypeptide. It kills cells by inhibiting protein synthesis by inactivating elongation factor-2 (EF-2).</p>\n<p><strong>Extraedge:</strong></p><p>Cholera toxin, by acting as a classical A-B type toxin, leads to ADP-ribosylation of G protein, and constitutive activation of AC, thereby giving rise to increased levels of cyclic AMP within the host cell</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An individual experiences diarrhea after eating raw shellfish in San Francisco. What is the most probable cause of the problem?", "options": [{"label": "A", "text": "Campylobacter jejuni", "correct": false}, {"label": "B", "text": "Salmonella choleraesuis", "correct": false}, {"label": "C", "text": "Shigella dysenteriae", "correct": false}, {"label": "D", "text": "Vibrio parahaemolyticus", "correct": true}], "correct_answer": "D. Vibrio parahaemolyticus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vibrio parahaemolyticus V ibrio parahaemolyticus is a curved, rod-shaped, Gram-negative bacterium found in brackish, saltwater, which, when ingested, causes gastrointestinal illness in humans. V. parahaemolyticus is oxidase positive, facultatively aerobic, and does not form spores .</p>\n<p><strong>Highyeild:</strong></p><p>Vibrio parahaemolyticus illnesses are associated with the consumption of shellfish . Symptoms of Vibrio parahaemolyticus infection usually occur within 24 hours (range, 4-96 hours) after ingesting the bacteria. Symptoms of Vibrio parahaemolyticus infection may include Watery diarrhea or Dysentry.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. jejuni is not commonly caused by the ingestion of shellfish. The clinical features are acute crampy abdominal pain, profuse diarrhea that may be grossly bloody, headache, malaise, and fever. Option: B. choleraesuis causes bacteremia with focal lesions. After oral infection, there is an early invasion of the bloodstream (with possible focal lesions in the lungs, bones, meninges, etc) Option: C . Shigella infection is spread by ingestion of contaminated food or drinks and all by direct contact with feces from an infected person. There is a sudden onset of abdominal pain, fever, and watery diarrhea.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is used to differentiate colonies of Vibrio cholerae and Vibrio parahemolyticus?", "options": [{"label": "A", "text": "MacConkey", "correct": false}, {"label": "B", "text": "Bile salt agar", "correct": false}, {"label": "C", "text": "TCBS Thiosulfate-citrate-bile salts-sucrose", "correct": true}, {"label": "D", "text": "DCA deoxycholate citrate agar", "correct": false}], "correct_answer": "C. TCBS Thiosulfate-citrate-bile salts-sucrose", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>TCBS Thiosulfate-citrate-bile salts-sucrose Vibrio cholerae, V. parahaemolyticus, and V. vulnificus are responsible for the majority of human infections.</p>\n<p><strong>Highyeild:</strong></p><p>TCBS Thiosulfate-citrate-bile salts-sucrose agar is a medium commonly used for isolating V. cholerae, V. parahaemolyticus, and other species from seafood . Common molecular methods for confirmation of typical V. parahaemolyticus isolates include DNA colony hybridization. V. parahaemolyticus is oxidase positive, facultatively aerobic, and does not form spores.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. The options are not relevant as they are not used in differentiating colonies of both Vibrio cholerae and Vibrio Parahemolyticus</p>\n<p><strong>Extraedge:</strong></p><p>The catalytic portion of cholera toxin performs a single function: it seeks out the G proteins used for cellular signaling and attaches an ADP molecule to them. This converts the G-protein into a permanently active state, so it sends a never-ending signal.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the bacterial shape as shown in the illustration?", "options": [{"label": "A", "text": "Bacillus", "correct": false}, {"label": "B", "text": "Vibrio", "correct": true}, {"label": "C", "text": "Spirillum", "correct": false}, {"label": "D", "text": "Spirochaete Alcaligenes faecalis", "correct": false}], "correct_answer": "B. Vibrio", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506311586-QTDV017005IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vibrio The given image demonstrates bacteria with monotrichous flagella which is seen in vibrio.</p>\n<p><strong>Highyeild:</strong></p><p>Vibrio is a genus of Gram-negative bacteria, possessing a curved-rod (comma) shape , several species of which can cause foodborne infection, usually associated with eating undercooked seafood. Typically found in salt water, Vibrio species are facultative anaerobes that test positive for oxidase and do not form spores. Vibrio is a genus of Gram-negative bacteria, possessing a curved-rod (comma) shape, several species of which can cause foodborne infection, usually associated with eating undercooked seafood.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Bacillus is a genus of gram-positive rod-shaped bacteria Option: C. Spirillum is a genus of gram-negative bacteria in the family Spirillaceae. There are two species of spirillum – Spirillum winogradskyi and Spirillum solutions. Option: D. Spirochaetes contain distinctive ideogram-negative bacteria, most of which have long, helically coiled cells.</p>\n<p><strong>Extraedge:</strong></p><p>A typical case of cholera shows 3 stages : Stage of evacuation. 2 Stage of collapse. Stage of collapse. Stage of recovery.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are correct about Vibrio parahemolyticus except:", "options": [{"label": "A", "text": "Green color on TCBS agar.", "correct": false}, {"label": "B", "text": "Shows darting motility", "correct": true}, {"label": "C", "text": "Causes food poisoning from seafood", "correct": false}, {"label": "D", "text": "Kanagawa phenomenon on Wagatsuma agar", "correct": false}], "correct_answer": "B. Shows darting motility", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Shows darting motility Vibrio parahaemolyticus is a curved, rod-shaped, Gram-negative bacterium found in brackish, saltwater, which, when ingested, causes gastrointestinal illness in humans. parahaemolyticus is oxidase positive, facultatively aerobic, and does not form spores. Most people become infected by eating raw or undercooked shellfish , particularly oysters(option C). Less commonly, this organism can cause an infection in the skin when an open wound is exposed to warm seawater. Show Green color colonies on TCBS agar. (option A) Show Kanagawa phenomenon on Wagatsuma agar-enhanced beta hemolysis. (option D) Movement on surfaces, or swarming motility, is effectively mediated by the lateral flagellar (leaf) system in the Vibrio parahaemolyticus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. V parahemolyticus is usually identified by its oxidase-positive growth on blood agar. Option: C. V parahemolyticus is a halophilic bacterium that causes acute gastroenteritis after ingestion of contaminated seafood such as raw fish or shellfish. Option: D. Thermostable direct hemolysis (TDH) produced by – V parahemolyticus causes beta-hemolysis in a special blood agar medium called Wagatsuma agar.</p>\n<p><strong>Extraedge:</strong></p><p>There are 3 stages, the first, stage of inflam- mation, the second, stage of villus fusing and the third, stage of villus resolution.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 50-year-old man recently visited India and developed diarrhea before returning to the United States. Vibrio cholerae O1 (El Tor, Ogawa) was isolated from his stool. Which of the following is the biotype of the V. cholerae strain?", "options": [{"label": "A", "text": "Classical", "correct": false}, {"label": "B", "text": "El Tor", "correct": true}, {"label": "C", "text": "O1", "correct": false}, {"label": "D", "text": "Ogawa", "correct": false}], "correct_answer": "B. El Tor", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>El Tor Vibrio cholerae Gram-stain. Cholera vibrios are slim, short, curved rods, about 0.5 x 3 μm in size. Cells may be linked end to end, forming S shapes and spirals.</p>\n<p><strong>Highyeild:</strong></p><p>Cholerae O1 has two biotypes, classical and El Tor, and each biotype has two distinct serotypes, Inaba and Ogawa. The symptoms of infection are indistinguishable, although more people infected with the El Tor biotype remain asymptomatic or have only a mild illness.</p>\n<p><strong>Extraedge:</strong></p><p>There are currently two vaccines for cholera: Dukoral and Shanchol. Both vaccines use whole killed V. cholerae cells however, Dukoral also contains recombinant cholera toxin β (rCTB). Some studies suggest that the inclusion of rCTB may improve vaccine efficacy in young children (2-10) and increase the duration of protection. This is countered by the costs of protecting and storing rCTB against degradation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 67-year-old male was admitted to an emergency with severe diarrhea, volition, and signs of dehydration. The stool sample was collected in a sterile container and sent to Microbiology for examination. On gross examination, the stool sample has a rice-watery appearance with no blood. The hanging drop was performed on the stool sample and the darting motility of the organism was seen. What is the most probable causative agent?", "options": [{"label": "A", "text": "Listeria monocytogenes", "correct": false}, {"label": "B", "text": "Vibrio cholerae", "correct": true}, {"label": "C", "text": "Mycoplasma pneumoniae", "correct": false}, {"label": "D", "text": "Borellia SPP.", "correct": false}], "correct_answer": "B. Vibrio cholerae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vibrio cholerae</p>\n<p><strong>Highyeild:</strong></p><p>Cholera toxin, by acting as a classical A-B type toxin, leads to ADP-ribosylation of G protein, and constitutive activation of AC, thereby giving rise to increased levels of cyclic AMP within the host cell</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Above case scenario is suggestive of Cholera infection. In Cholera, stool is typically non-bilious, cloudy and watery with mucus flakes without Blood and pus cells resembling rice water. Motility test is done by Hanging Drop method in which Vibrio is actively motile with sudden rapid movement frequently changing direction like a dart, described as Darting motility. Organism Motility type Listeria (option A) Tumbling Mycoplasma (option C) Gliding Borellia/Spirochete (OPTION D) Lashing Giardia Falling leaf like Trichomonas Twitching Proteus Swarming on blood agar Vibrio Darting/shooting stars</p>\n<p><strong>Extraedge:</strong></p><p>There are currently two vaccines for cholera: Dukoral and Shanchol. Both vaccines use whole killed V. cholerae cells however, Dukoral also contains recombinant cholera toxin β (rCTB). Some studies suggest that the inclusion of rCTB may improve vaccine efficacy in young children (2-10) and increase the duration of protection. This is countered by the costs of protecting and storing rCTB against degradation</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old boy was admitted to an emergency with severe diarrhea, vomiting, and signs of dehydration. The stool sample was collected in a sterile container and sent to Microbiology for examination. On gross examination, the stool sample has a rice-watery appearance with no blood. The hanging drop was performed on the stool sample and the darting motility of the organism was seen. Which of the. The following statement is correct about the biotypes of suspected organisms?", "options": [{"label": "A", "text": "El Tor biotype is susceptible resistant to Mukherjee phage V and resistant susceptible to phage IV.", "correct": false}, {"label": "B", "text": "Voges-proskauer test is positive for classical biotypes.", "correct": false}, {"label": "C", "text": "El Tor biotypes result in beta hemolysis on sheep blood agar.", "correct": true}, {"label": "D", "text": "Chick erythrocyte agglutination test is positive for Classical biotype.", "correct": false}], "correct_answer": "C. El Tor biotypes result in beta hemolysis on sheep blood agar.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>El Tor biotypes result in beta hemolysis on sheep blood agar. Serogroup 01 of Vibrio cholerae has two bio types: classical and El Tor on the basis of biochemical reactions and their susceptibilty to Polymyxin B and Bacteriophages. Basu and Mukherjee phage typing was the most widely used scheme to differentiate 01 biotypes. Differences between Classical and El Tor Biotypes Classical El Tor Beta hemolysis on blood agar (option C) Negative Positive Chick Erythrocyte agglutination (option D) Negative Positive Voges-Proskauer test (option B) Negative Positive Polymyxin B (50 IU) Susceptible Resistant Phage IV susceptibility (option A) Phage V susceptibility Susceptible Resistant Resistant Susceptible</p>\n<p><strong>Highyeild:</strong></p><p>Laboratory diagnosis: Clinical specimens : vomitus, stool. Cultural characteristics: -Vibrio cholera species are non-Halophilic. -They grow on different media at high pH (8.5-9.5) as alkaline peptone water. - TCBS is a selective medium. - On MacConkey's agar : non- lactose fermenting colonies. - On blood agar: Usually beta haemolytic. All Vibrio species are: Facultative anaerobic.</p>\n<p><strong>Extraedge:</strong></p><p>Since cholera toxin has been shown to preferentially bind to GM1 gangliosides, this characteristic can be utilized for membrane studies. Lipid rafts are difficult to study as they vary in size and lifetime, as well being part of an extremely dynamic component of cells. Using cholera toxin β as a marker, we can get a better understanding of the properties and functions of lipid rafts.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old boy was admitted to the emergency with severe diarrhea, vomiting, and signs of dehydration. The stool sample was collected in a sterile container and sent to Microbiology for examination. On gross emanation, the stool sample has a rice-watery appearance with no blood. The hanging drop was performed on a stool sample and the darting motility of the organism was seen. The stool sample was inoculated in enrichment media and cultured on a selective media. Which of the following is the correct enrichment and selective media to be used in this case?", "options": [{"label": "A", "text": "Selenite F broth and Deoxycholate agar", "correct": false}, {"label": "B", "text": "Gram-negative broth and TCBS agar", "correct": false}, {"label": "C", "text": "Monsur's taurocholate tellurite Peptone water and deoxycholate agar", "correct": false}, {"label": "D", "text": "Alkaline peptone water and TCBS agar", "correct": true}], "correct_answer": "D. Alkaline peptone water and TCBS agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Alkaline peptone water and TCBS agar The above case scenario is suggestive of Cholera infection . In Cholera, the stool is typically non-bilious, cloudy, and watery with mucus flakes without Blood and pus cells resembling rice water. The motility test is done by the Hanging Drop method in which Vibrio is actively motile with sudden rapid movement frequently changing direction like a dart, described as Darting motility. To inhibit the growth of commensals present in a stool sample, the fecal sample should inoculate on both enrichment broth and selective media which contain 0.5-1% salt and have alkaline pH allowing V. Cholerae to grow but inhibit the growth of commensals.</p>\n<p><strong>Highyeild:</strong></p><p>Enrichment broth: Alkaline peptone water (APW) Monsur’s taurocholate tellurite peptone water Selective Media: TCBS agar : Thiosulfate, citrate, bile salts sucrose agar. V. cholerae can ferment sucrose and therefore produce large yellow colonies Alkaline bile salt agar (BSA): cholerae produces translucent oil drop colonies Monsur’s gelatin taurocholate trypticase tellurite agar (GTTTA): V. cholerae produces translucent colonies with a grayish-black center and a turbid halo. Classical biotypes grow better on this medium than on TCBS agar</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Selenite F broth is enrichment broth and Deoxycholate agar is selective media for the isolation of Salmonella and Shigella. Option B. Gram Negative broth is enrichment broth used for the isolation of Shigella. Option C. In option C, Monsur’s taurocholate tellurite Peptone water is used for Vibrio but Deoxycholate agar is used to isolate Shigella. So Option C is also incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 67-year-old male was admitted to an emergency with severe diarrhea of rice water appearance, vomiting, and signs of dehydration. The stool sample was collected in a sterile container and sent to Microbiology for examination. The stool sample was inoculated on TCBS agar in which yellow color colonies were grown after 24 hours of incubation at 37 degrees Celsius. Which of the following statement is incorrect regarding the pathogenesis of the suspected organism?", "options": [{"label": "A", "text": "Adhesion of organism to the intestinal epithelium is facilitated by Toxin-regulated pilus.", "correct": false}, {"label": "B", "text": "Fragment B of Cholera toxin binds with GM1 receptors on the intestinal epithelium.", "correct": false}, {"label": "C", "text": "Cholera toxin results in a decrease of cAMP in the intestinal epithelium.", "correct": true}, {"label": "D", "text": "Inhibition of the absorptive sodium transport system is responsible for watery diarrhea.", "correct": false}], "correct_answer": "C. Cholera toxin results in a decrease of cAMP in the intestinal epithelium.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cholera toxin results in a decrease of cAMP in the intestinal epithelium. Fragment A of Cholera toxin results in the accumulation of ion cAMP (cyclic adenosine monophosphate) inside the intestinal epithelium. Step 4: Active fragment A causes ADP ribosylation of G protein and results in accumulation of cAMP due to up regulation of adenylate cyclase activity.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Pathogenesis of Cholera Cholerae is transmitted by oral route by ingestion of contaminated food and water. Reduced gastric acidity promotes its transmission in the case of the use of antacids and hypochlorhydria. Step 1: Cross the mucus layer with the help of its high motility, mucin asr, and cholera lectin. Option: A. Step 2: Adhesion to intestinal epithelium facilitated by type IV fimbria called a toxin-regulated pilus. Step 3: Cholera toxin (CT) is produced which consists of 2 fragments- A and B Option: B. Step3: Fragment B of CT binds to GM1 ganglioside receptors on intestinal epithelium and results in internalization of fragment A. Option: D. Step 5: CAMP inhibits the absorptive sodium transport system in villus cells and activates the secretory chloride transport system in crypt cells, which leads to the accumulation of sodium chloride in the intestinal lumen and passive loss of water ithe nto intestinal lumen to maintain osmolality. This results in accumulation of isotonic fluid and watery diarrhoea. Although a gram negative bacteria; endotoxin plays no role in pathogenesis.</p>\n<p><strong>Extraedge:</strong></p><p>A typical case of cholera shows 3 stages : Stage of evacuation. 2 Stage of collapse. Stage of collapse. Stage of recovery.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 27-year-old male presented in Medicine OPD with history suggestive gastroenteritis. A stool sample was collected and sent for bacteriological examination in the Microbiology department. The sample was inoculated onto TCBS agar and the growth of bacteria was shown in the below diagram. On gram stain from the growth shows capsulated gram-negative bacilli with bipolar staining and can resist up to 8% NaCl. What is the most probable causative agent?", "options": [{"label": "A", "text": "Vibrio cholerae", "correct": false}, {"label": "B", "text": "Vibrio parahaemolyticus", "correct": true}, {"label": "C", "text": "Vibrio vulnificus", "correct": false}, {"label": "D", "text": "Vibrio alginolyticus", "correct": false}], "correct_answer": "B. Vibrio parahaemolyticus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506312397-QTDV017012IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vibrio parahaemolyticus Vibrio parahaemolyticus is a halo halophilic Philip vibrio which can withstand higher salt concentrations up to 8%and non-lactose fermenter. While Vibrio cholerae is non-Halophilic and can tolerate NaCl up to 6%. On TCBS agar, V. Parahaemolyticus produces green colonies as it does not ferment sucrose. It is capsulated gram-negative bacilli with bipolar staining. It also shows the Kanazawa phenomenon on wagatsuma agar</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Vibrio cholerae is non-halophilic and can tolerate NaCl up to 6%. On TCBS agar, it produces yellow colonies as it is a sucrose fermenter and the gram stain reveals short curved gram-negative bacilli. Option: C. Vibrio vulnificus is halophilic Vibrio can withstand NaCl up to 8%. It is a lactose fermenter. Option: D. Vibrio alginolyticus causes eye, ear, and wound infection. It is the most salt-tolerant Vibrio and can grow at salt concentrations of more than 10%</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 22 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 26-year-old man comes to the office due to a 3-day history of dysuria and urethral discharge. The symptoms developed about 2 weeks after he had unprotected sexual intercourse with a new partner. His temperature is 37.1 °C (98.8 °F). On physical examination, a mucoid discharge is expressed with gentle milking of the penis. Gram stain of the discharge reveals numerous neutrophils with intracellular diplococci. A sample of the discharge is placed on an antibiotic-containing medium, and bacterial colonies are cultured. Which of the following terms best describes the medium?", "options": [{"label": "A", "text": "Differential", "correct": false}, {"label": "B", "text": "Enrichment", "correct": false}, {"label": "C", "text": "Reducing", "correct": false}, {"label": "D", "text": "Selective", "correct": true}], "correct_answer": "D. Selective", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Selective This patient with dysuria and urethral discharge has gonococcal urethritis as indicated by the Gram stain showing gram-negative diplococci within leukocytes. N eisseria gonorrhoea e can be cultured on Modified Thayer-Martin Medium which is a selective medium, which contains vancomycin, colistin, nystatin, and trimethoprim. These antibiotics kill potential contaminants such as gram-positive organisms (vancomycin), gram-negative organisms other than Neisseria (colistin and trimethoprim), and fungi (nystatin).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Differential media help identify cultured organisms based on their metabolic and biochemical properties. Examples of differential media include the MacConkey and eosin methylene blue (EMB) agars used to culture enteric organisms. Organisms that ferment lactose will appear pink on MacConkey agar and black on EMB agar. Option B. Enrichment media contain special growth factors required for some organisms. Examples include the X and V factors required by Haemophilus or the anaerobic conditions needed by Clostridium species. Option C. Reducing media (e.g., thioglycollate broth) removes oxygen and is used to culture anaerobic organisms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The sputum specimen of a 70-year-old male suspected of having pneumonia was cultured on 5 percent sheep blood agar. The culture showed alpha-hemolytic colonies the next day. Further processing of this organism is most likely to yield-", "options": [{"label": "A", "text": "Gram-positive cocci in short chains, Catalase negative and bile resistant", "correct": false}, {"label": "B", "text": "Gram-positive cocci in pairs, Catalase negative and bile soluble", "correct": true}, {"label": "C", "text": "Gram-positive cocci in clusters, Catalase-positive and coagulase positive", "correct": false}, {"label": "D", "text": "Gram-negative coccobacilli, Catalase positive and oxidase positive", "correct": false}], "correct_answer": "B. Gram-positive cocci in pairs, Catalase negative and bile soluble", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gram-positive cocci in pairs, Catalase negative and bile soluble Diagnosis- pneumonia caused by S.pneumoniae. pneumoniae is Gram-positive cocci in pairs or chains of variable length, Catalase negative and bile soluble Streptococcus is a genus of gram-positive coccus or spherical bacteria that belongs to the family Streptococcaceae. Cell division in streptococci occurs along a single axis, so as they grow, they tend to form pairs or chains that may appear bent or twisted. Viridans streptococci are a heterogeneous group of α-hemolytic and nonhemolytic streptococci that are constituents of the normal flora of the respiratory and gastrointestinal tracts of infants, children, and adults.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. As the suspected causative agent is streptococci, these options are not relevant to alpha-hemolytic streptococci species.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 8-year-old boy was bitten by a stray cat. Two days later, the wound was red and swollen and drained of purulent fluid. Pasteurella multocida was cultured from the wound. The drug of choice to treat this infection is:", "options": [{"label": "A", "text": "Amikacin", "correct": false}, {"label": "B", "text": "Erythromycin", "correct": false}, {"label": "C", "text": "Gentamicin", "correct": false}, {"label": "D", "text": "Amox-clavulanic acid", "correct": true}], "correct_answer": "D. Amox-clavulanic acid", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Amox-clavulanic acid P. Multocida infections, amoxicillin-clavulanate, a beta-lactamase inhibitor, is seen as the treatment of choice. Treatment also requires the use of antimicrobials targeted at the elimination of both aerobic and anaerobic, Gram-negative bacteria which may also be associated with animal bite</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 55-year-old man who is being treated for adenocarcinoma of the lung is admitted to a hospital because of fever, chest pain, and cough. Gram stain of the sputum is unremarkable, and culture reveals many small, gram-negative rods able to grow only on a charcoal yeast extract agar. The most likely organism is?", "options": [{"label": "A", "text": "Chlamydia trachomatis", "correct": false}, {"label": "B", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "C", "text": "Legionella pneumophila", "correct": true}, {"label": "D", "text": "M. pneumonia", "correct": false}], "correct_answer": "C. Legionella pneumophila", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Legionella pneumophila Buffered charcoal yeast extract (BCYE) agar is a selective growth medium used to culture or grow certain types of bacteria, particularly the Gram-negative species Legionella pneumophila. BCYE agar provides L-cysteine and other nutrients required for the growth of Legionella pneumophila, the causative agent of Legionnaires pneumonia. Buffered Charcoal Yeast Extract (BCYE) Agar is used for the primary isolation and cultivation of Legionella pneumophila and other Legionella species.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Chlamydia trachomatis serovar D-K causes sexually transmitted disease, especially in developed countries, and may also produce infection of the eye (inclusion conjunctivitis). Culture is done via the shell vial method which is the most sensitive culture method. Option B. pneumoniae is a gram-negative, non-motile, encapsulated, lactose fermenting, facultatively anaerobic, rod-shaped bacterium. It is cultured on MacConkey agar which appears as a mucoid fermenter. Option D. M. pneumoniae is a prominent cause of pneumonia, especially in persons 5-20 years of age.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Corynebacterium diphtheriae can be grown within 6-8 hrs on:", "options": [{"label": "A", "text": "Blood Agar", "correct": false}, {"label": "B", "text": "MacConkey’s agar", "correct": false}, {"label": "C", "text": "Dorset’s egg medium", "correct": false}, {"label": "D", "text": "Loeffler's serum slope", "correct": true}], "correct_answer": "D. Loeffler's serum slope", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Loeffler's serum slope Corynebacterium diphtheriae is a rod-shaped, Gram positive, non-spore-forming, and nonmotile bacteria. Loffler serum slope -Grows rapidly in 6 -8 hours. Corynebacterium diphtheriae show metachromatic granules and grow on LoeffIer's serum slope very rapidly and colonies can be seen in 6–8 hours.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. diphtheriae grows well on blood agar, but tellurite blood agar (Hoyle’s medium) is recommended. Time taken is 18-24 hours. Characteristic colonies appear in 36-48 hours. On cysteine-tellurite agar, the colonies are black with a brown halo. Option B. diphtheriae does not grow on MacConkey agar. Option C. Dorset’s egg medium is a non-selective medium well suited for maintenance of pure cultures of mycobacterium.</p>\n<p><strong>Extraedge:</strong></p><p>Colony Morphology of Corynebacterium diphtheriae on cultural media table,tr,th,td {border:1px solid black;} Media Colony Morphology Loeffler's Serum slope They grow on this medium very rapidly. Colonies appear after 6-8 hours of incubation. The colonies are small, circular white or creamy and glistening Tellurite Blood Agar Grey or black colonies. Based on colony morphology on tellurite medium, three main biotypes - Gravis, Intermedius and Mitis. C. diphtheria on Potassium tellurite blood agar (KTBA)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old child presents with fever and cervical lymphadenopathy. Oral examination shows a gray membrane on the right tonsil. Which of the following will be ideal for rapid identification of the pathogen:", "options": [{"label": "A", "text": "Nutrient agar", "correct": false}, {"label": "B", "text": "Blood agar", "correct": false}, {"label": "C", "text": "Loeffler’s serum slope", "correct": true}, {"label": "D", "text": "Löwenstein Jensen medium", "correct": false}], "correct_answer": "C. Loeffler’s serum slope", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Loeffler’s serum slope Diagnosis- Pseudomembrane formation due to C.diphtheria infection. Corynebacterium diphtheriae is a rod-shaped, Gram-positive, non-spore-forming, and nonmotile bacteria. Corynebacterium diphtheriae show metachromatic granules and grow on LoeffIer's serum slope very rapidly and colonies can be seen in 6–8 hours.</p>\n<p><strong>Highyeild:</strong></p><p>Volutin granules are polymetaphosphate an intracytoplasmic storage form of complex inorganic polyphosphate, the production of which is used as one of the identifying criteria when attempting to isolate Corynebacterium diphtheriae on Löffler's medium . Metachromatic granules present at ends or poles of bacilli (also called polar bodies or Babes Ernst bodies or volutin granules): They are storage granules composed of poly metaphosphates. They are better stained with special stains, such as Albert’s, Neisser’s, and Ponder’s stains. The most frequent cause of death is airway obstruction or suffocation following aspiration of the pseudomembrane. Cervical edema and cervical lymphadenopathy from diphtheria infection produce a bull's neck appearance in this child. Diphtheria-causing bacteria may produce a toxin. This toxin damages tissue in the immediate area of infection — usually, the nose and throat. At that site, the infection produces a tough, gray-colored membrane composed of dead cells, bacteria, and other substances. This membrane can obstruct breathing.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & B. diphtheriae grows well on blood agar, but tellurite blood agar (Hoyle’s medium) is recommended. Time taken is 18-24 hours. Characteristic colonies appear in 36-48 hours. On cysteine-tellurite agar, the colonies are black with a brown halo. Option D. Lowenstein-Jensen medium is specially used for mycobacterium species, especially M. tuberculosis. It is time-consuming and hence cannot be used as a rapid test.</p>\n<p><strong>Extraedge:</strong></p><p>Volutin granules can also be possessed by: Corynebacterium xerosis Gardnerella vaginalis Spirillum Few Mycobacterium species</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Medium which acts as an enriched and differential medium-", "options": [{"label": "A", "text": "Blood agar", "correct": true}, {"label": "B", "text": "MacConkey’s medium", "correct": false}, {"label": "C", "text": "CLED Cystine-Lactose-Electrolyte-Deficient Agar", "correct": false}, {"label": "D", "text": "Stuart’s medium", "correct": false}], "correct_answer": "A. Blood agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Blood agar Enriched media contain the nutrients required to support the growth of a wide variety of organisms, including some of the more fastidious ones. They are commonly used to harvest as many different types of microbes as are present in the specimen. A medium may be enriched, by the addition of blood or serum. Differential media are bacteriological growth media that contain specific ingredients to allow one to distinguish selected species or categories of bacteria by visual observation. Differential Media are used to distinguish between closely related organisms or groups of organisms. The medium may be enriched, by the addition of blood or serum. Enriched media include sheep blood agar and chocolate (heated blood) agar. Blood agar is one type of differential medium, allowing bacteria to be distinguished by the type of hemolysis produced. It is considered to be differential but not selective because it is an enriched medium that provides a rich nutrient environment for many types of bacteria, while a selective medium supports the growth of certain types of bacteria but inhibits other types.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. MacConkey agar is a selective and differential culture medium for bacteria. It is designed to selectively isolate gram-negative and enteric bacteria and differentiate them based on lactose fermentation. Option C. CLED is a valuable non-inhibitory growth medium used in the isolation and differentiation of urinary microbes. Option D. Stuart’s medium is a non-nutritional medium that maintains the viability of organisms without significant multiplication.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Usual concentration of blood used for blood agar:", "options": [{"label": "A", "text": "5-10 %", "correct": true}, {"label": "B", "text": "15-20 %", "correct": false}, {"label": "C", "text": "30-40 %", "correct": false}, {"label": "D", "text": "20-25 %", "correct": false}], "correct_answer": "A. 5-10 %", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>5-10 % Blood Agar is a general-purpose enriched medium used to grow fastidious organisms and to differentiate bacteria based on their hemolytic properties. It is a highly nutritious medium generally used as a basal medium for preparing blood agar by supplementation with blood. Blood agar is a differential medium that distinguishes bacterial species by their ability to break down red blood cells. The ability to break down the cells will cause a change in the color of the blood agar. BAPs are enriched, differential media used to isolate fastidious organisms and detect hemolytic activity.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. These concentrations are not usually used</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Obligate anaerobes cannot withstand oxygen because of the absence of: Peroxidase Superoxide dismutase Cytochrome oxidase Catalase Select the correct answer from given below code:", "options": [{"label": "A", "text": "A B C", "correct": false}, {"label": "B", "text": "B C", "correct": false}, {"label": "C", "text": "A B D", "correct": true}, {"label": "D", "text": "B C D", "correct": false}], "correct_answer": "C. A B D", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A B D Obligate anaerobes are microorganisms killed by normal atmospheric concentrations of oxygen. Obligate anaerobes are organisms that can only live in environments that lack oxygen. Obligate anaerobes cannot tolerate oxygen because they utilize metabolic schemes built around enzymes that react with oxidants. The reliance upon low-potential flavoproteins for anaerobic respiration probably causes substantial superoxide and hydrogen peroxide to be produced when anaerobes are exposed to air. Obligate anaerobes lack superoxide dismutase and catalase and/or peroxidase and therefore undergo lethal oxidations by various oxygen radicals when they are exposed to O2 (OPTION A, B, and D). Aerotolerant anaerobes: They do not utilize oxygen for growth, but tolerate its presence. This is because they possess small amounts of superoxide dismutase and peroxidase (but lack catalase) which may neutralize the toxic oxygen radicals. Examples include Clostridium histolyticum and Bacteroides. Option C. The enzyme cytochrome c oxidase Complex IV is a large transmembrane protein complex found in bacteria, archaea, and mitochondria of eukaryotes.</p>\n<p><strong>Extraedge:</strong></p><p>Types of anaerobes Obligate anaerobic bacteria- Are those bacteria that can grow in the absence of free oxygen, but fails to multiply in the presence of oxygen on the surface of nutritionally adequate solid media incubated in room air or in a CO2 incubator (containing 5-10% CO2). eg.- Bacteroides fragilis, Clostridium perfringens, C. novyi, Porphyromonas, Fusobacterium. Aerotolerant anaerobes - Anaerobic bacteria that will show limited or scanty growth on agar in room air or in a 5-10% CO2 incubator, but show good growth under anaerobic conditions. eg.- C. carnis, C. histolyticum, C. tertium etc. Microaerophilic bacteria- Organism require O2 as a terminal electron acceptor, yet these do not grow on the surface of solid media in an aerobic incubator (21% O2) & grow minimally if at all under anaerobic condition eg.- Campylobacter jejuni (grow in 5% O2).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Robert Koch's assistant advised him to use agar instead of gelatin for solidifying culture media for the cultivation of bacteria:", "options": [{"label": "A", "text": "Agar has more nutrition", "correct": false}, {"label": "B", "text": "Gelatin melts at 37-degree Celsius", "correct": true}, {"label": "C", "text": "Gelatin is not easily available", "correct": false}, {"label": "D", "text": "Agar is cheaper", "correct": false}], "correct_answer": "B. Gelatin melts at 37-degree Celsius", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gelatin melts at 37-degree Celsius Agar was first described for use in microbiology in 1882 by the German microbiologist Walther Hesse, an assistant working in Robert Koch's laboratory, at the suggestion of his wife Fannie Hesse. Agar quickly supplanted gelatin as the base of microbiological media, due to its higher melting temperature, allowing microbes to be grown at higher temperatures without the media liquefying. Agar: It is used for solidifying the culture media. It has no nutritional properties. It is prepared from seaweeds (red algae of species Gelidium and Gracilaria). Agar is preferred over gelatine, as it is bacteriologically inert, and it melts at 98°C and usually solidifies at 42°C.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The following phenomenon is responsible for antibiotic resistance in bacteria due to slime production:", "options": [{"label": "A", "text": "Co-aggregation", "correct": false}, {"label": "B", "text": "Biofilm formation", "correct": true}, {"label": "C", "text": "Mutation evolving in altered target site for antibiotics", "correct": false}, {"label": "D", "text": "Mutation evolving a target bypass mechanism", "correct": false}], "correct_answer": "B. Biofilm formation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Biofilm formation Biofilm formation is a process whereby microorganisms irreversibly attach to and grow on a surface and produce extracellular polymers that facilitate attachment and matrix formation, resulting in an alteration in the phenotype of the organisms with respect to growth rate and gene transcription. The following phenomenon is responsible for antibiotic resistance in bacteria due to slime production. Biofilm formation</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Co-aggregation is the highly specific recognition and adhesion of genetically distinct bacteria. Options C and D. Not the correct option</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cystine lactose electrolyte deficient medium is preferred over MacConkey’s medium because:", "options": [{"label": "A", "text": "Former prevents swarming of Proteus", "correct": false}, {"label": "B", "text": "It is a differential medium", "correct": false}, {"label": "C", "text": "Prevents the growth of Pseudomonas", "correct": false}, {"label": "D", "text": "Allows the growth of Candida", "correct": true}], "correct_answer": "D. Allows the growth of Candida", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Allows the growth of Candida CLED media is Differential and Indicator Media CLED is not Selective media thus promoting the growth of candida whereas MacConkey’s medium does not allow the growth of candida.</p>\n<p><strong>Highyeild:</strong></p><p>CLED Cystine-Lactose-Electrolyte-Deficient agar is a valuable non-inhibitory growth medium used in the isolation and differentiation of urinary microbes. Culture Media: Urine is inoculated onto: MacConkey agar and blood agar combination or CLED (cysteine lactose electrolyte deficient) agar. It contains cysteine and lactose and is electrolyte-deficient. The latter trait prevents the swarming of Proteus species. Cystine promotes the formation of cystine-dependent dwarf colonies. CLED Agar is suitable for the isolation and counting of many aerobically growing microorganisms, such as Enterobacteriaceae, Pseudomonas, and other non-fermenting Gram-negative rods, enterococci, staphylococci, Candida species, and many others from urine specimens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is used for staining bacterial endospores?", "options": [{"label": "A", "text": "Loeffler’s methylene blue with safranin as counterstain", "correct": false}, {"label": "B", "text": "Malachite green with safranin as counterstain", "correct": true}, {"label": "C", "text": "Crystal violet with safranin as counterstain", "correct": false}, {"label": "D", "text": "Giemsa with safranin as counterstain", "correct": false}], "correct_answer": "B. Malachite green with safranin as counterstain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Malachite green with safranin as counterstain Because of their t ough protein coats made of keratin , spores are highly resistant to normal staining procedures. The primary stain in the endospore stain procedure, malachite green, is driven into the cells with heat. The purpose of the counterstain is to stain the vegetative cells that lost the primary stain. Therefore, endospores will appear green in color while the vegetative cells will be pink/reddish in color under the microscope.</p>\n<p><strong>Highyeild:</strong></p><p>ZN stain has three components: Primary stain: Basic fuchsin + Phenol Decolorizer: Sulfuric acid or acid-alcohol Counterstain: Methylene blue or Malachite Green</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. These staining techniques are not useful in staining bacterial endospores as it requires staining that penetrates the wall thickness of spore bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which one of the following is true?", "options": [{"label": "A", "text": "Agar has nutrient properties", "correct": false}, {"label": "B", "text": "Chocolate medium is a selective medium", "correct": false}, {"label": "C", "text": "Addition of selective substances in a solid medium is called enrichment media", "correct": false}, {"label": "D", "text": "Nutrient broth is a basal medium", "correct": true}], "correct_answer": "D. Nutrient broth is a basal medium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nutrient broth is a basal medium Nutrient Broth is a general-purpose medium used for cultivating a broad variety of fastidious and non-fastidious microorganisms with non-exacting nutritional requirements. Peptone and yeast extract provide nitrogenous compounds, vitamin B complex, amino acids, and other essential growth nutrients. Basal media are basically simple media that support most non-fastidious bacteria. Peptone water, nutrient broth, and nutrient agar are considered as basal mediums. These media are generally used for the primary isolation of microorganisms.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Agar has no nutrient properties. It is used to solidify media. Option B. Chocolate medium or chocolate blood agar, is a non-selective, enriched growth medium used for isolation of fastidious pathogenic bacteria. Option C. Enrichment media is a media that allows only the growth of a particular type of microorganism. Inhibitors are usually added to enrichment media to stop the growth of unwanted organisms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "E.coli O157:H7 the causative organism for HUS can be identified by culturing stool samples on:", "options": [{"label": "A", "text": "Deoxycholate citrate agar", "correct": false}, {"label": "B", "text": "Sorbitol MacConkey Agar", "correct": true}, {"label": "C", "text": "Chocolate agar", "correct": false}, {"label": "D", "text": "Cysteine electrolyte deficient agar", "correct": false}], "correct_answer": "B. Sorbitol MacConkey Agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sorbitol MacConkey Agar E.Coli O157:H7 does not ferment Sorbitol and produces clear colonies on Sorbitol MacConkey Agar. Sorbitol MacConkey agar is a variant of traditional MacConkey agar used in the detection of E. coli O157:H7. Traditionally, MacConkey agar has been used to distinguish those bacteria that ferment lactose from those that do not. E coli O157:H7. SMAC agar specifically differentiates between non-pathogenic E coli and the pathogenic E coli strain O157:H7. By utilizing the lactose available in the medium, Lac+ bacteria such as Escherichia coli, Enterobacter, and Klebsiella will produce acid, which lowers the pH of the agar and results in the appearance of pink colonies. coli O157:H7 can be detected by plating fresh feces on sorbitol–MacConkey agar.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. Specimens of E.coli are plated on both blood agar and differential media. With differential media, rapid preliminary identification of gram-negative enteric bacteria is often possible.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Culture medium used for diagnosis of EHEC O157: H7 is:", "options": [{"label": "A", "text": "O culture", "correct": false}, {"label": "B", "text": "Sorbitol MacConkey medium", "correct": true}, {"label": "C", "text": "XLD agar", "correct": false}, {"label": "D", "text": "DCA (deoxycholate citrate agar) medium", "correct": false}], "correct_answer": "B. Sorbitol MacConkey medium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sorbitol MacConkey medium Selective agar for the isolation and differentiation of enterohaemorrhagic (EHEC) E. coli O157:H7-strains from food and clinical material. In sorbitol MacConkey agar, lactose is replaced by sorbitol. 0157:H7 E.coli cannot ferment sorbitol, so this strain uses peptone to grow. This raises the pH of the medium, allowing the pathogenic strain to be differentiated from other non-pathogenic E. coli strains through the action of the pH indicator in the medium.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Specimens of E.coli are plated on both blood agar and differential media. With differential media, rapid preliminary identification of gram-negative enteric bacteria is often possible Option C. XLD agar is a selective media used for gram-negative, such as Salmonella and Shigella Option D. DCA agar is used for the isolation of enteric pathogens such as Salmonella Paratyphi. It is inhibitory to most of the gut bacteria such as Proteus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Shigella can be divided into sub-groups on the basis of ability to ferment:", "options": [{"label": "A", "text": "Lactose", "correct": false}, {"label": "B", "text": "Maltose", "correct": false}, {"label": "C", "text": "Fructose", "correct": false}, {"label": "D", "text": "Mannitol", "correct": true}], "correct_answer": "D. Mannitol", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mannitol The Shigella genus itself is separated into four serogroups or species based on antigen type: S. dysenteriae, S. flexneri, S. sonnei, and S. boydii. Shigella is divided into mannitol fermenting and non-fermenting species. All Shigella species ferment mannitol except Shigella dysenteriae and some serotypes of Shigella flexneri. The ability of rapid mannitol fermentation is characteristic of S. flexneri.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. All shigella ferment glucose. With the exception of Shigella sonnei, they do not ferment lactose.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following are the special laboratory conditions needed to recover Campylobacter jejuni?", "options": [{"label": "A", "text": "37°C (98.6°F) aerobic on blood agar plates", "correct": false}, {"label": "B", "text": "37°C (98.6°F) anaerobic on blood agar plates", "correct": false}, {"label": "C", "text": "42°C (107.6°F) microaerophilic on skirrow's medium", "correct": true}, {"label": "D", "text": "42°C (107.6°F) aerobic on skirrow's medium", "correct": false}], "correct_answer": "C. 42°C (107.6°F) microaerophilic on skirrow's medium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>42°C (107.6°F) microaerophilic on skirrow's medium C. jejuni is microaerophilic and grows well at 42 deg C (thermophilic) on Skirrow's medium. Campylobacter Agar (Butzler) and BD Campylobacter Agar (Skirrow) are selective media for the isolation of Campylobacter species from clinical and other specimens. Microbiological method. The genus Campylobacter includes important pathogens causing intestinal infections such as diarrhea. Heat with frequent agitation and boil for one minute. Sterilize at 121º C for 15 minutes. Cool to 42-45 º C and aseptically add 150 ml of Hemolyzed Sheep Blood and 10 ml of Supplements Skirrow. Dispense into sterile Petri dishes. Incubate Campylobacter jejuni and Campylobacter coli at 42°C to accelerate growth. Campylobacter species are Gram-negative and microaerophilic.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is Not true about Campylobacter?", "options": [{"label": "A", "text": "Campylobacter jejuni is the most common pathogenic Strain in India", "correct": false}, {"label": "B", "text": "Poultry is the main source of infection", "correct": false}, {"label": "C", "text": "Humans are the chief natural reservoir", "correct": true}, {"label": "D", "text": "Implicated as a causative agent of Guillain Barre Syndrome", "correct": false}], "correct_answer": "C. Humans are the chief natural reservoir", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Humans are the chief natural reservoir Humans are not the only reservoir of infection. Campylobacter is found in the gastrointestinal tract of many animals used for food (including poultry, cattle, sheep, and swine) and many household pets. Campylobacter jejuni is a bacterial enteric pathogen and is a zoonotic Gram-negative bacterial pathogen . The main route of transmission is generally believed to be foodborne, via undercooked meat and meat products, as well as raw or contaminated milk. Contaminated water or ice is also a source of infection. The chief animal reservoirs of Campylobacter spp. were chickens, dogs, pigs, cats, and wild birds, and chicken meat was the only food product that was frequently contaminated.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. jejuni is the most common pathogenic strain in India Option B. The infection is acquired by the oral route from food, drink or contact with infected animals or animal products, especially poultry. Option D. Certain serotypes of C. jejuni have been associated with post-diarrheal Guillain-barre syndrome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Culture media for fungus routinely used is:", "options": [{"label": "A", "text": "Chocolate agar", "correct": false}, {"label": "B", "text": "Thioglycollate broth", "correct": false}, {"label": "C", "text": "Blood agar", "correct": false}, {"label": "D", "text": "sabouraud's agar", "correct": true}], "correct_answer": "D. sabouraud's agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>sabouraud's agar Sabouraud agar or Sabouraud dextrose agar is a type of agar growth medium containing peptones. It is used to cultivate dermatophytes and other types of fungi, and can also grow filamentous bacteria such as Nocardia. The advantage of using a Sabouraud agar is the low acidity that discourages bacteria. Indicate the significance of the following structures in the reproductive activities of yeast cells. The acidic pH (5.6) of traditional Sabouraud agar inhibits bacterial growth.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Chocolate agar (CHOC) or chocolate blood agar (CBA), is a nonselective, enriched growth medium used for isolation of pathogenic bacteria. It is a variant of the blood agar plate, containing red blood cells that have been lysed by slowly heating to 80°C . Chocolate agar is used for growing fastidious respiratory bacteria, such as Haemophilus influenzae and Neisseria meningitidis. Option B. Thiosulfate-citrate-bile salts-sucrose agar, or TCBS agar, is a type of selective agar culture plate that is used to isolate vibrios Option C. Blood agar is an enriched, bacterial growth medium. Fastidious organisms, such as streptococci, do not grow well on ordinary growth media but grow on blood agar. Blood agar is a type of growth medium with trypticase soy agar base enriched with 5% sheep blood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Candida albicans can be identified on cornmeal agar by-", "options": [{"label": "A", "text": "Pseudo hyphae", "correct": false}, {"label": "B", "text": "Yeast cells", "correct": false}, {"label": "C", "text": "Chlamydospores", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Chlamydospores", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlamydospores Candida albicans is an opportunistic pathogenic yeast that is a common member of the human gut flora. Corn Meal Agar is primarily used to elicit chlamydospore production. Corn Meal Agar is a general-purpose medium used for the cultivation of fungi and for the study of Candida species for chlamydospore production. Polysorbate 80 is a mixture of oleic esters, which activates the production of chlamydospore by Candida albicans, and Candida tropicalis. Most candida species produce pseudohyphae and yeast cells hence not helpful in identifying C. albicans specifically.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following species of candida produces the characteristic thick-walled terminal chlamydospores on corn meal agar?", "options": [{"label": "A", "text": "C. albicans", "correct": true}, {"label": "B", "text": "C. tropicalis", "correct": false}, {"label": "C", "text": "C. krusei", "correct": false}, {"label": "D", "text": "C. pseudotropicalis", "correct": false}], "correct_answer": "A. C. albicans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. albicans Candida albicans is an opportunistic pathogenic yeast that is a common member of the human gut flora. It can also survive outside the human body. It is detected in the gastrointestinal tract and mouth in 40–60% of healthy adults. Candida albicans is the most common yeast that we live with. It's found naturally on our skin and in certain parts of our bodies. Chlamydospores are characteristic of Candida albicans, C. dubliniensis (see figure below for placement of spores) Arrow indicating juvenile spore; and (H) terminal position of spores on sporogenic. Chlamydospore formation of the fungal pathogen Candida albicans was found. found. Chlamydospores formed as terminal thick-walled cells on short side branches.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Selective media for Meningococcus is:", "options": [{"label": "A", "text": "Blood agar", "correct": false}, {"label": "B", "text": "Deoxycholate citrate media", "correct": false}, {"label": "C", "text": "Modified Thayer-Martin media", "correct": true}, {"label": "D", "text": "McLeod media", "correct": false}], "correct_answer": "C. Modified Thayer-Martin media", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Modified Thayer-Martin media Modified Thayer Martin Medium (MTM) is a selective medium used for the isolation of meningococcus and gonococcus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Blood agar is an enriched media Option B. Deoxycholate citrate medium is selective for Shigella. Option D. Macleod medium is selective for C. diphtheriae</p>\n<p><strong>Extraedge:</strong></p><p>Thayer - Martin agar Chocolate agar has been modified to be selective for Neisseria gonorrhoeae and Neisseria meningitidis by the addition of antibiotics, (V-C-N inhibitor) including: Colistin: to inhibit most gram negative bacteria other than Neiseria. Vancomycin: to inhibit most gram positive bacteria. Nystatin or anisomycin to inhibit yeast. Modified Thayer - Martain agar includes trimethoprim to inhibit - Proteus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 33 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 61-year-old man comes to the office due to a painful rash on his face for the past 3 days. The patient has no other medical conditions and takes no medications. He is a retired school teacher and lives with his wife. The remainder of the physical examination shows no abnormalities. Which of the following events most likely immediately preceded the appearance of skin rash in this patient?", "options": [{"label": "A", "text": "Alteration in the patient's normal skin flora", "correct": false}, {"label": "B", "text": "Close physical contact with an infected person", "correct": false}, {"label": "C", "text": "Inhalation of pathogen-containing aerosols", "correct": false}, {"label": "D", "text": "Reactivation of the latent organism in sensory ganglia", "correct": true}], "correct_answer": "D. Reactivation of the latent organism in sensory ganglia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Reactivation of the latent organism in sensory ganglia This patient has a crusted vesicular rash in a dermatomal distribution consistent with shingles (herpes zoster).</p>\n<p><strong>Highyeild:</strong></p><p>Shingles Shingles are caused by the reactivation of varicella-zoster virus (VN), a double-stranded DNA virus of the herpesvirus family. Primary VZV infection occurs most commonly in childhood. Inoculation in the nasopharyngeal mucosa is followed by migration of the virus to the regional lymphatics. Subsequent dermatotrophic migration produces a diffuse vesicular rash associated with fever, malaise, and pharyngitis ( chickenpox ). Then, the virus migrates via sensory nerves to the cranial nerve and dorsal spinal ganglia, where it lies dormant for decades. Most patients who have had primary chickenpox do not develop recurrent diffuse disease. Over time, however, waning cell-mediated immune function allows reactivation of the virus, which typically spreads down a single spinal nerve to cause a painful, erythematous, vesicular rash in a dermatomal distribution. The primary risk factor for reactivation is increasing age; other factors can include malignancy, autoimmune disease, and immune-suppressing therapy. The varicella vaccine is recommended for the prevention of primary disease in children, women of childbearing age, adults with sustained risk of exposure, and household contacts of immunocompromised hosts. The zoster vaccine is recommended for adults age d >50 and reduces the risk of reactivation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Colonization of the skin by transient flora (eg, Staphylococcus aureus, Candida species, gram-negative bacilli occasionally leads to clinical disease, especially following antibiotic exposure (eg, vaginal candidiasis). However, VZV does not remain on the surface of the skin for prolonged periods and is not caused by flora change Options B and C. Primary VZV infection (ie, chickenpox) can be acquired by direct contact or airborne aerosol from patients with active chickenpox or zoster lesions . However, primary VN infection causes diffuse lesions, and lesions in a dermatomal distribution are seen only with reactivation from the sensory ganglia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 9-year-old girl is brought to the emergency department following a 3-minute generalized seizure. She has had a fever with a worsening headache for 3 days. The girl has no medical problems and is not taking any medications. On physical examination, she is disoriented and has difficulty staying awake and speech alteration. The patient becomes unresponsive the following day and dies overnight. Autopsy reveals bilateral, hemorrhagic necrosis of the inferior and medial temporal lobes. This patient's condition was most likely caused by infection with which of the following?", "options": [{"label": "A", "text": "Enterovirus", "correct": false}, {"label": "B", "text": "Herpes simplex virus", "correct": true}, {"label": "C", "text": "Naegleria fowleri", "correct": false}, {"label": "D", "text": "Neisseria meningitides", "correct": false}], "correct_answer": "B. Herpes simplex virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Herpes simplex virus Herpes simplex virus type 1 (HSV-1 ) encephalitis is the most common cause of fatal sporadic encephalitis or inflammation of the brain parenchyma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Enterovirus, particularly group B coxsackievirus, is the most common cause of viral meningitis in children. Less commonly, enterovirus causes encephalitis and acute flaccid paralysis, but temporal lobe involvement is not typical. Option C. Naegleria fowleri is a free-living, protozoan parasite that causes rapid meningoencephalitis with a high mortality rate. N fowleri is found in freshwater, and transmission occurs through nasal inhalation during recreational activities (eg, swimming, diving). After spreading through the cribriform plate to the olfactory cortex, infection leads to symptoms of encephalitis, as described above, in addition, to smell and taste abnormalities. Inflammation can be seen in the frontal and temporal lobes, brainstem, and meninges. Option D. Neisseria meningitidis and Streptococcus pneumoniae are the 2 most common causes of bacterial meningitis. Unlike encephalitis, meningitis does not affect the brain parenchyma; rather, infection of the connective tissue layers of the brain leads to classic symptoms of fever, nuchal rigidity, and altered mental status.</p>\n<p><strong>Extraedge:</strong></p><p>HSV-1 encephalitis results from a primary oropharyngeal infection that travels via the olfactory tract or from the reactivation of the latent virus in the trigeminal ganglion with subsequent spread into the cerebral vault. CT, MRI, and post-mortem macroscopic brain examination reveal edema and hemorrhagic necrosis of the temporal lobe. Unilateral involvement is the most common, but bilateral necrosis can also occur. Definitive diagnosis is made by polymerase chain reaction testing of cerebrospinal fluid. Symptoms of acute encephalitis include acute onset of headache, fever, mental status changes (eg, lethargy, disorientation), cranial nerve deficits (eg, Bell's palsy), and seizures. Temporal lobe damage can result in receptive aphasia and personality changes</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 22-year-old woman comes to the office for a routine prenatal visit. She is 16 weeks pregnant with her first child. Two months ago, she had a mononucleosis-like illness with fever, myalgia, and fatigue, and she was diagnosed with cytomegalovirus infection. The patient recovered with symptomatic treatment and is currently asymptomatic. Her other medical problems include episodic migraine headaches and benign choroidal nevus. She takes prenatal vitamins and does not use tobacco, alcohol, or illicit drugs. The patient has a family history of hypertension and glaucoma. Physical examination findings and prenatal ultrasound are unremarkable. This patient's unborn infant is at greatest risk for which of the following eye conditions?", "options": [{"label": "A", "text": "Chorioretinitis", "correct": true}, {"label": "B", "text": "Choroidal nevus", "correct": false}, {"label": "C", "text": "Congenital cataract", "correct": false}, {"label": "D", "text": "Glaucoma", "correct": false}], "correct_answer": "A. Chorioretinitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chorioretinitis Up to 5% of women develop primary cytomegalovirus (CMV) infection (typically a mononucleosis-like illness with fever and mild hepatitis) during pregnancy. Vertical transmission to the fetus occurs in approximately one-third of cases , with the highest risk of transmission occurring in the first trimester. CMV-related complications observed in infants exposed to the virus in utero include c horioretinitis (the most common eye-related problem), sensorineural deafness, seizures, jaundice, hepatomegaly, splenomegaly, and microcephaly.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Choroidal nevus (eye freckle) is a nonhereditary, usually benign pigmented area underneath the retina and is not associated with -Utero CMV infection. Option C. Congenital cataract can be seen with in-utero rubella infection Option D. Glaucoma can be present at birth and may be primary or secondary (eg, turner). However, it is not a known complication of CMV infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A previously healthy 2-year-old boy is brought to the clinic with a fever and mouth pain that began yesterday. He has consumed an adequate amount of fluids but refuses to eat due to the pain. The patient has no medical problems and takes no medications. Physical examination reveals swollen gums and vesicular, inflamed lesions on his hard palate and lips. He has enlarged and tender cervical lymph nodes. Which of the following is most likely responsible for this patient's condition?", "options": [{"label": "A", "text": "DNA virus, double-stranded, enveloped", "correct": true}, {"label": "B", "text": "DNA virus, double-stranded, non-enveloped", "correct": false}, {"label": "C", "text": "DNA virus, single-stranded, non-enveloped", "correct": false}, {"label": "D", "text": "RNA virus, double-stranded, positive-sense", "correct": false}], "correct_answer": "A. DNA virus, double-stranded, enveloped", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>DNA virus, double-stranded, enveloped Primary herpes simplex virus type 1 (HSV-1) infection is characterized by gingivostomatitis (vesicles on the lips and hard palate, fever, lymphadenopathy) seen in this young patient. Recurrent HSV-1 infection causes lip lesions that are typically less severe due to existing cellular and humeral immunity from prior infection. HSV-1 and other herpesviruses are enveloped and possess double-stranded DNA genomes. Transmission is usually by direct contact with infected oral secretions or lesions. Inoculation occurs on mucosa or skin where the virus replicates rapidly in the host cell nucleus and causes abnormal cell division, resulting in intranuclear inclusion bodies and multinucleated giant cells visible on the Tzanck smear. The vesicular lesions result from cell lysis and necrosis as well as tissue destruction, inflammation, and fluid accumulation between the dermis and epidermis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Most DNA viruses are double-stranded. They are enveloped (ie, surrounded by a lipid layer) or non-enveloped (ie, lacking a surrounding lipid layer). Adenovirus is a non-enveloped, double-stranded DNA virus that typically causes self-limited upper respiratory infection or gastroenteritis. Option C. Parvovirus is a single-stranded, non-enveloped DNA virus that causes erythema infectiosum, or fifth disease. Patients classically present with fever, cough, and rhinorrhea followed by a \"slapped-cheek\" and lacy, reticular truncal rash. Option D. Rotavirus, a type of reovirus, is a double-stranded, positive-sense, non-enveloped RNA virus. Rotavirus infection is a vaccine-preventable disease characterized by profuse, watery diarrhoea in children.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old man comes to the physician due to fever, myalgias, malaise, and progressive fatigue over 2-weeks. He has not experienced any sore throat. He recently received a blood transfusion while hospitalized for a bleeding duodenal ulcer. Physical examination shows mild splenomegaly. There is no lymphadenopathy and no jaundice. Lymphocytosis is identified in the peripheral blood with 30% atypical lymphocytes. The patient's serum fails to agglutinate horse erythrocytes. The agglutination test is repeated a week later and, again, no agglutination is noted. HIV testing is negative. Which of the following is the most likely cause of this patient's condition?", "options": [{"label": "A", "text": "Coxsackievirus A", "correct": false}, {"label": "B", "text": "Cytomegalovirus", "correct": true}, {"label": "C", "text": "Epstein-Barr virus", "correct": false}, {"label": "D", "text": "Hepatitis C virus", "correct": false}], "correct_answer": "B. Cytomegalovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cytomegalovirus In immunocompetent patients with a heterophile antibody-negative mononucleosis-like syndrome, t he most likely diagnosis is cytomegalovirus (CMV) infection. Pharyngitis and lymphadenopathy are seen less commonly than with EBV. CMV can be acquired during the transfusion of leukocyte-laden blood products, as the virus infects leukocytes of granulocyte-macrophage lineage. Other causes of heterophile antibody-negative mononucleosis-like syndromes include h uman herpesvirus-6, HIV, and toxoplasmosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Coxsackie A viruses cause aseptic meningitis and herpangina (fever, posterior pharyngeal grey vesicles/ulcers) in children. Option C. Most cases of infectious mononucleosis (IM), caused by the Epstein-Barr virus (EBV), are associated with serum heterophile antibodies that agglutinate with erythrocytes from unrelated species (eg, horse erythrocytes in the Monospot test, sheep erythrocytes in the classic Paul Bunnell test). The agglutination test may be negative at the beginning of the infection and can be repeated later for confirmation. Because the Monospot (horse erythrocyte agglutination) test was negative on 2 separate occasions in this patient with a mononucleosis-like syndrome (fever, fatigue, splenomegaly, atypical lymphocytosis), his symptoms are unlikely to be due to EBV Epstein–Barr; the lack of sore throat and lymphadenopathy is also atypical for classic EBY-associated IM. Option D. Acute hepatitis C (HCV) rarely causes symptoms. Transfusion-acquired HCV hepatitis C virus can cause chronic hepatitis, but highly sensitive blood donor screening tests have led to low transmission rates . Atypical lymphocytosis is less common with HCV than with EBV Epstein–Barr or CMV</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old boy is brought to the office with 3 days of fever, irritability, and oral lesions. His parents are concerned due to his refusal to eat or drink and lack of urination today. Physical examination demonstrates painful ulcers on the tongue and gingiva, swollen gums, and cervical lymphadenopathy. The remainder of his examination is unremarkable. Microscopic examination of an oral ulcer base scraping is shown in the image below: Which of the following is most likely the cause of this patient's condition?", "options": [{"label": "A", "text": "Abortive infection", "correct": false}, {"label": "B", "text": "Latent infection", "correct": false}, {"label": "C", "text": "Primary infection", "correct": true}, {"label": "D", "text": "Slow virus infection", "correct": false}], "correct_answer": "C. Primary infection", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689250119365-QTDV063007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Primary infection The above image depicts a Tzanck smear , in which epithelial cells are scraped from an ulcer base and stained. The presence of multi-nucleated giant cells is suggestive of herpes simplex virus (HSV) infection, which is consistent with this child's symptoms.</p>\n<p><strong>Highyeild:</strong></p><p>Primary HSV1 infection Tzanck smears are insensitive and do not differentiate between HSV and varicella-zoster virus infection. Therefore, Tzanck smears largely have been replaced by polymerase chain reaction testing. Primary infection with HSV-1 results in herpetic gingivostomatitis. The peak age for primary infection is age 6 months to 5 years . Prodromal symptoms (eg, fever, malaise, chills) begin approximately 1 week after contact with an infected person (who is generally asymptomatic). Painful vesicles appear, extensively covering the lips and gingiva, and may include the palate, tongue, or oropharynx. The vesicles organize into extensive ulcers and resolve within 1-2 weeks.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. An abortive viral infection refers to an infection in which the virus enters the cell but does not successfully produce a new infective virus. Therefore, an abortive infection is not capable of causing disease. Option B. HSV is capable of latency by integrating into the trigeminal (or sacral, for HSV-2) ganglia. However, during latency, no virus is produced and therefore no clinical disease occurs. Option D. A slow virus infection is characterized by a prolonged incubation period that lasts months to years. Slow virus infections are predominantly progressive, degenerative disorders of the central nervous system (eg, subacute sclerosing panencephalitis following measles infection).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old man came to the office due to white plaques on his buccal mucosa that he incidentally discovered while brushing his teeth. After appropriate workup, he was found to be HIV positive, with a CD4+ T lymphocyte count of 280/mm3. He was referred to an infectious diseases specialist for follow-up but was noncompliant with appointments. The patient returns 3 years later due to several months of pain and itching in the perirectal area. He also has intermittent rectal bleeding and often sees bright red blood on the tissue after wiping. The patient did not seek medical care because he thought he had haemorrhoids. On examination, a single, hard mass with superficial ulceration measuring approximately 2x2 cm is noted in the anal canal. No haemorrhoids are present. There is no palpable regional lymphadenopathy. Which of the following pathogens is most likely responsible for this patient's current anal pathology?", "options": [{"label": "A", "text": "Human papillomavirus", "correct": true}, {"label": "B", "text": "Adenovirus", "correct": false}, {"label": "C", "text": "Cytomegalovirus", "correct": false}, {"label": "D", "text": "Epstein-Barr virus", "correct": false}], "correct_answer": "A. Human papillomavirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Human papillomavirus This patient with HIV likely has a nal squamous cell carcinom a given the duration of pain, itching, and rectal bleeding in addition to the visible ulcerative mass (anal cancers are ulcerative in > 50% of cases). Anogenital squamous cell carcinomas and their precursors, squamous intraepithelial lesions, have been linked to human papillomavirus (HPV) infection.</p>\n<p><strong>Highyeild:</strong></p><p>Hpv And Cancers: intraepithelial neoplasias of the cervix, vulva, penis, and anus have a well-documented association with HPV types 16 and 18. A strong correlation between HPV and invasive carcinoma has been established for cervical cancer. Immunodeficiency states (eg, AIDS) increase host susceptibility to HPV infection and more severe infection. HIV-positive men who have sex with men are at increased risk of developing anal squamous cell carcinoma (anal intercourse is hypothesized to be related), and HIV-positive women are more prone to developing cervical squamous cell carcinoma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Adenoviruses can cause severe upper respiratory illnesses, pneumonia, conjunctivitis etc in immunosuppressed and immunocompetent patients. Option C. HIV-positive patients with CD4+ cell counts < 100/mm3 are at significantly increased risk of developing cytomegalovirus (CMV) infection, which most frequently causes retinitis in patients. CMV involvement of the gastrointestinal tract typically manifests as esophageal ulcers or colitis, not anal masses. Option D. HIV-positive patients often experience reactivation of latent Epstein-Barr virus (EBV) infection. EBV replication in such patients is associated with certain lymphomas (Hodgkins and NHL) and with oral hairy leukoplakia, which typically manifests as white plaques on the lateral tongue margins (this patient's white buccal plaques on initial diagnosis were more likely thrush due to Candida).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An otherwise healthy 3-year-old child is brought to the paediatrician with umbilicated, flesh-coloured papules on his trunk. This condition is related to infection with which of the following viruses?", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": false}, {"label": "B", "text": "Herpesvirus 6", "correct": false}, {"label": "C", "text": "Parvovirus", "correct": false}, {"label": "D", "text": "Poxvirus", "correct": true}], "correct_answer": "D. Poxvirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Poxvirus Molluscum Contagiosum: 2–4 mm umbilicated papules, with a translucent, glossy appearance, located at various sites on the skin surface.</p>\n<p><strong>Highyeild:</strong></p><p>Molluscum contagiosum is a viral infection of the epidermal keratinocytes caused by poxvirus. The only pox virus is specific for humans in the post-smallpox era. Found worldwide and spread by close human contact. Lesions are generally numerous, characteristically 2–4 mm umbilicated skin-coloured papules, with a translucent, glossy appearance, located at various sites on the skin surface. Lesions of poxvirus infection begin as erythematous macules that quickly become papular, leading to a transient vesicular stage that gives rise to a pustule and then a crust. If the lesion is on a mucous membrane, vesicles form, leading to ulcer formation. Healing with scar formation is typical. Poxvirus infections typically result in the formation of lesions, skin nodules, or disseminated rash. Infection in humans usually occurs due to contact with contaminated animals, people, or materials. Management is by local therapy (cryotherapy, excision, podophyllotoxin, etc.)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A & C. No umbilicated papules. Option B. Human herpesvirus 6 is the common collective name for human betaherpesvirus 6A and human betaherpesvirus 6B. These closely related viruses are two of the nine known herpes viruses that have humans as their primary host.</p>\n<p><strong>Extraedge:</strong></p><p>Largest virus: Pox virus (300 nm) AND Smallest virus: Parvovirus (20 nm)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Poxviridae is a family of double-stranded DNA viruses. Vertebrates and arthropods serve as natural hosts. There are currently 83 species in this family, divided among 22 genera, which are divided into two subfamilies. Diseases associated with this family include smallpox. Which poxvirus does not grow in cell lines?", "options": [{"label": "A", "text": "Cowpox", "correct": false}, {"label": "B", "text": "Molluscum contagiosum", "correct": true}, {"label": "C", "text": "Variola", "correct": false}, {"label": "D", "text": "Vaccinia", "correct": false}], "correct_answer": "B. Molluscum contagiosum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Molluscum contagiosum Molluscum contagiosum is a skin infection caused by the virus Molluscum contagiosum. It produces benign raised bumps, or lesions, on the upper layers of your skin. Lesions: It produces pink pearly wart-like lesions with a characteristic dimple at the centre (umbilicated). Lesions are found anywhere on the body except on the palms and soles. Genital lesions are seen in adults. Not cultivable: It cannot be propagated in tissue culture, egg or in animals.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C and D. All other pox viruses can be cultivated. Vaccinia is most commonly used as a vaccine-delivery virus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "While some poxviruses, such as smallpox (variola virus), no longer exist in nature, other poxviruses can still cause disease. Smallpox is a serious, contagious, and sometimes fatal infectious disease. There is no specific treatment for smallpox disease, and the only prevention is vaccination. Smallpox belongs to which class of poxviruses:", "options": [{"label": "A", "text": "Parapoxvirus", "correct": false}, {"label": "B", "text": "Capripoxvirus", "correct": false}, {"label": "C", "text": "Leporipoxvirus", "correct": false}, {"label": "D", "text": "Orthopoxvirus", "correct": true}], "correct_answer": "D. Orthopoxvirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Orthopoxvirus Smallpox is caused by the variola virus, genus Orthopoxvirus. Other members of this genus that can infect humans are the vaccinia virus, monkeypox virus, and cowpox virus. Orthopoxvirus is a genus of viruses in the family Poxviridae and subfamily Chordopoxvirinae. Orthopox: The family of viruses to which belongs vaccinia, the virus that causes smallpox. Variola virus is large and brick-shaped with a single linear double-stranded DNA genome and contains a hairpin loop at each end. Four orthopoxviruses cause infection in humans: variola, vaccinia, cowpox, and monkeypox. Variola virus infects only humans in nature . Vaccinia, cowpox, and monkeypox viruses can infect both humans and other animals in nature.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Parapoxvirus - Bovine papular stomatitis virus. Grey sealpox virus. Orf virus. Pseudocowpox virus. Red deerpox virus. Option B. Capripoxvirus - lumpy skin disease Option C. Leporipoxvirus - californian myxoma virus etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Most common recurrent disease caused by herpes simplex virus type I is:", "options": [{"label": "A", "text": "Herpes labialis", "correct": true}, {"label": "B", "text": "Herpes vulvovaginitis", "correct": false}, {"label": "C", "text": "Herpes kerato conjunctivitis", "correct": false}, {"label": "D", "text": "Aseptic meningitis", "correct": false}], "correct_answer": "A. Herpes labialis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Herpes labialis Herpes labialis is caused by herpes simplex virus type 1 (HSV-1) . Cold sores are the result of the virus reactivating in the body. Herpes labialis - Oral infections by the type 1 strain of herpes simplex virus (HSV-1) are most common; however, cases of oral infection by the type 2 strain are increasing. Specifically, type 2 has been implicated as causing 10–15% of oral infections.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option b - The primary symptom of herpes vaginitis is pain associated with lesions or sores. These sores usually are visible on the vulva or the vagina but are occasionally inside the vagina and can only be seen during a gynecologic exam. Option C. HSV (Herpes Simplex Virus) keratitis is an infection of the cornea—the clear dome that covers the coloured part of the eye—that is caused by HSV. The infection usually heals without damaging the eye, but more severe infections can lead to scarring of the cornea or blindness. Option D. Aseptic meningitis is an umbrella term for all of the causes of inflammation of the brain meninges that h ave negative cerebrospinal fluid (CSF) bacterial cultures . It is one of the most common inflammatory disorders of the meninges.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements most accurately describes HSV infections?", "options": [{"label": "A", "text": "HSV establishes lytic infection in neural ganglion cells", "correct": false}, {"label": "B", "text": "Latent HSV infections can be prevented in persons with functional cell-mediated immunity", "correct": false}, {"label": "C", "text": "Primary and recurrent HSV infections are treated with drugs that inhibit the viral DNA polymerase", "correct": true}, {"label": "D", "text": "HSV infection is transmitted via direct contact with asymptomatic shedding of viral particles in active lesions", "correct": false}], "correct_answer": "C. Primary and recurrent HSV infections are treated with drugs that inhibit the viral DNA polymerase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Primary and recurrent HSV infections are treated with drugs that inhibit the viral DNA polymerase For the episodic treatment of recurrent genital herpes, dosing options for acyclovir, Valciclovir inhibit viral DNA polymerase by competing as these are nucleoside analogues. These drugs inhibit virus replication and may suppress clinical that all initial genital herpes infections be treated with antivirals to reduce any potential, Useful for recurrent episodes of genital HSV.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. The initial (primary) infection of oral herpes is usually the worst. It may cause severe, flu-like symptoms, including swollen lymph nodes and headaches. However, some people have no symptoms at all. During the initial infection, sores can occur on and around the lips and throughout the mouth. Option B. Primary HSV-1 and HSV-2 infections are accompanied by systemic signs, a longer duration of symptoms, and a higher rate of complications. Option A. Recurrent infections are typically milder and shorter.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A newborn infant has multiple, hemorrhagic, cutaneous lesions and does not respond to sound. Head CT scan shows periventricular calcifications. The most likely cause of this child's presentation?", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": true}, {"label": "B", "text": "Herpes simplex", "correct": false}, {"label": "C", "text": "Rubella", "correct": false}, {"label": "D", "text": "Syphilis", "correct": false}], "correct_answer": "A. Cytomegalovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cytomegalovirus Although any part of the brain can be involved, the preferential damage to the developing germinal matrix by cytomegalovirus classically results in a predominantly periventricular distribution of calcification. Neonatal cytomegalovirus infection remains a common cause of congenital infection worldwide with effects ranging from hearing impairment. In patients with congenital CMV infection, calcification most commonly is thick and chunky and periventricular.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Deafness, eye abnormalities, and congenital heart defects are the most common symptoms of CRS (Congenital Rubella syndrome). Neurologic abnormalities, such as a reduced head size (microcephaly) and mental retardation, and other abnormalities, including spleen, liver or bone marrow problems, and low birth weight may also occur. Option D. They include body rashes that last 2 – 6 weeks — often on the palms of your hands and the soles of your feet. other symptoms, including mild fever, fatigue, sore throat, hair loss, weight loss, swollen glands, headache, and muscle pains. Option B. HSV usually transfers perinatally to the infant especially when there are genital lesions. Options C, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cytomegalovirus (CMV) infection is common. Which one of the following statements best characterizes CMV?", "options": [{"label": "A", "text": "It can be transmitted across the placental barrier", "correct": true}, {"label": "B", "text": "While a common infection, CMV is almost always symptomatic", "correct": false}, {"label": "C", "text": "The CMV can be cultured from the red blood cells of infected patients.", "correct": false}, {"label": "D", "text": "Unlike, other viral infections, CMV is not activated by immunosuppressive therapy", "correct": false}], "correct_answer": "A. It can be transmitted across the placental barrier", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It can be transmitted across the placental barrier Although the human placenta functions as a barrier to microorganisms, certain viruses that disseminate in blood, such as human cytomegalovirus (CMV), can be transmitted from the maternal to the fetal compartment. In 40% of pregnancies complicated by primary CMV infection, the virus is transmitted to the fetus. Rather, cytotrophoblasts in several locations become infected, suggesting specific routes by which the virus reaches the fetus in utero.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. While a common infection, CMV is almost always symptomatic - Not true Option C. The CMV do not infect RBCs. Option D. CMV infection can be activated into a disease by immunosuppressive therapy. Options B, C and D. Are not the correct statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "There is a considerable overlap of signs and symptoms seen in congenital and perinatal infections. In a neonate with “classic” symptoms of congenital cytomegalovirus (CMV) infection, which one of the following tests would be most useful in establishing a diagnosis?", "options": [{"label": "A", "text": "CMV IgG titer on neonate’s serum at birth", "correct": false}, {"label": "B", "text": "CMV IgG titer on mother’s serum at the birth of an infant", "correct": false}, {"label": "C", "text": "CMV IgM titer on neonate’s serum at birth and 1 month of age", "correct": true}, {"label": "D", "text": "Total IgM on neonate’s serum at birth", "correct": false}], "correct_answer": "C. CMV IgM titer on neonate’s serum at birth and 1 month of age", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>CMV IgM titer on neonate’s serum at birth and 1 month of age Positive results on CMV-IgG antibodies in neonates should be interpreted with caution since maternal IgG is transferred passively from mother to baby before birth.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. When looking at CMV-IgM kinetics following primary infection, peak levels are seen in the first 1-3 months, after which the titers begin. Option B. The IgM antibody may remain positive for 9 to 12 months after an acute infection. Vertical transmission of CMV to the infant occurs in utero by transplacental. Option D. Total IgM has no significance in the detection of congenital CMV infection. Options A, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Atypical lymphocytosis is most likely to be found in which one of the following diseases?", "options": [{"label": "A", "text": "Encephalitis caused by herpes simplex virus (HSV)", "correct": false}, {"label": "B", "text": "Mononucleosis induced by Epstein-Barr virus", "correct": true}, {"label": "C", "text": "Parvovirus infection", "correct": false}, {"label": "D", "text": "Chronic hepatitis C", "correct": false}], "correct_answer": "B. Mononucleosis induced by Epstein-Barr virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mononucleosis induced by Epstein-Barr virus During acute EBV disease, the number of lymphocytes increases to 50–60% of the total leukocytes in the peripheral blood (a count of 20,000–50,000/ml), of which 10% are atypical lymphocytes (95% are T lymphocytes, 5% are B lymphocytes), or Downey cells.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. These WBCs are \"atypical\" because they are larger (more cytoplasm) and have nucleoli in their nuclei. Not in HSV- A virus causing contagious cold sores, most often around the mouth or on the genitals. Option C. The cytoplasm tends to be indented by surrounding RBCs. Not in parvovirus. Primate erythroparvovirus 1, generally referred to as B19 virus, parvovirus B19 or sometimes erythrovirus B19, is the first known human virus in the family Parvoviridae, genus Erythroparvovirus; it measures only 23–26 nm in diameter. Such atypical lymphocytes are often associated with infectious mononucleosis from Epstein-Barr virus (EBV) infection. Option D. Chronic hepatitis C infection is not associated with lymphocytosis. Options A, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Exanthems of childhood Measles ('first disease') Uncommon in those populations with vaccination Acute, highly infectious disease characterized by cough, coryza, fever, and rash. Severe manifestations and complications include pneumonia, encephalitis, bacterial superinfection, and SSPE Rubella ('third disease') Prior to vaccination, incidence was highest in spring amongst children aged 5-9 years Acute mild exanthematous viral infection of children and adults resembling mild measles, but with the potential to cause fetal infection and birth defects Parvovirus B19 (slapped cheek disease, erythema infectiosum, 'fifth disease') Infection common in childhood-50% are IgG-positive by 15 years 20% asymptomatic. Prodrome (5- 7 days) of myalgia, arthralgia, malaise, rhinorrhoea, and fever, then a bright red rash on the cheeks, followed 1-2 days later by a maculopapular rash on the trunk, legs, arms, and buttocks. This clears after a few days, leaving a characteristic lacey pattern which fades/reappears over the following 3 weeks HHV-6 (roseola, exanthem subitum, 'sixth disease') Most children acquire infection between 4 months and 3 years of age Abrupt onset of fever (± periorbital oedema) is followed 3-5 days later by a rash (rose-pink papules which are mildly elevated, non-pruritic, and blanch on pressure) on the back and neck and spreads to the chest and limbs, sparing the feet and face. Lasts ~2 days. Other features: malaise, vomiting, diarrhoea, cough, pharyngitis and lymphadenopathy, febrile convulsions (10% of primary infections). Meningitis and encephalitis are less commonly seen Mumps 90% of cases occurred in those under 15 years prior to the introduction of vaccination. Many cases now occur in older children and those at university Acute generalized viral infection of children and adolescents, causing swelling and tenderness of the salivary glands, and rarely epididymo-orchitis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Infectious mononucleosis, also called “mono,” is a contagious disease. Epstein-Barr virus (EBV) is the most common cause of infectious mononucleosis, but other viruses can also cause this disease. It is common among teenagers and young adults, especially college students. The correct statement about Infectious Mononucleosis is:", "options": [{"label": "A", "text": "Caused by Cytomegalovirus", "correct": false}, {"label": "B", "text": "The virus belongs to the alpha subfamily", "correct": false}, {"label": "C", "text": "Caused by Salivary gland Viruses", "correct": false}, {"label": "D", "text": "Also called Kissing Disease", "correct": true}], "correct_answer": "D. Also called Kissing Disease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Also called Kissing Disease Infectious mononucleosis, or mono, is commonly referred to as the “kissing disease” because it's spread through saliva. I nfectious mononucleosis (IM, mono), also known as glandular fever, is an infection usually caused by the Epstein–Barr virus (EBV). Infectious mononucleosis is a syndrome of sore throat, fever, and lymphadenopathy, with atypical lymphocytosis; 80– 90% of cases are due to EBV, which is generally associated with a positive heterophile antibody test. Most of the remainder are caused by CMV. Young adults and adolescents are most frequently affected.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Infectious mononucleosis (mono) is often called the kissing disease. The virus that causes mono is transmitted through saliva, so you can get it through kissing, but you can also be exposed through a cough or sneeze, or by sharing a glass or food utensils with someone who has mono. Option B. Belongs to gamma herpes virus subfamily Option C. Not the correct option.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The Epstein–Barr virus, formally called Human gammaherpesvirus 4, is one of the nine known human herpesvirus types in the herpes family and is one of the most common viruses in humans. EBV is a double-stranded DNA virus. Epstein Barr virus causes all the following except:", "options": [{"label": "A", "text": "Infectious mononucleosis", "correct": false}, {"label": "B", "text": "Measles", "correct": true}, {"label": "C", "text": "Nasopharyngeal carcinoma", "correct": false}, {"label": "D", "text": "Non-Hodgkins lymphoma", "correct": false}], "correct_answer": "B. Measles", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Measles Measles is caused by a single-stranded, enveloped RNA virus with 1 serotype. It is classified as a member of the genus Morbillivirus in the Paramyxoviridae family. Humans are the only natural hosts of the measles virus. Epstein-Barr virus (EBV) is a double-stranded DNA virus belonging to the Herpes family and the primary cause of infectious mononucleosis (IM), a common infection worldwide with a lifetime prevalence of 90%.</p>\n<p><strong>Highyeild:</strong></p><p>EBV associations with other diseases Neoplastic disorders — Burkitt’s lymphoma (tumour from >95% of African cases contains EBV; malaria may be a cofactor), nasopharyngeal carcinoma, HIV- associated non- Hodgkin’s lymphoma, Hodgkin’s lymphoma, and both polyclonal B- and T- cell lymphomas. Infection in immunocompromised children— several congenital immunodeficiencies are associated with the development of EBV-associated lymphoproliferative disorders. X- linked immunoproliferative syndrome has a particular association with acute fatal infectious mononucleosis with hepatic necrosis and pancytopenia. EBV and HIV — EBV is associated with polyclonal B- cell lymphomas in AIDS patients and is the cause of oral hairy leukoplakia . In children, it is associated with smooth muscle tumours.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Infectious mononucleosis (IM, mono), also known as glandular fever, is an infection usually caused by the Epstein–Barr virus (EBV). Option C. Epstein–Barr virus (EBV) is associated with multiple types of human cancer, including lymphoid and epithelial cancers. The closest association with EBV infection is seen in undifferentiated nasopharyngeal carcinoma (NPC). Option D. EBV can cause some types of NHL-Non Hodgkin's lymphoma. Options A, C and D. Are caused by EBV.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 3-year-old girl presented to her paediatrician’s office with a fever, swollen lymph nodes, and a vesicular rash on her chest and upper arms. The vesicles were at various stages of development: some were newly forming, while some were crusted over. Which of the following infectious agents is the most likely cause of this girl's rash?", "options": [{"label": "A", "text": "Smallpox", "correct": false}, {"label": "B", "text": "Parvovirus B19", "correct": false}, {"label": "C", "text": "Epstein-Barr virus", "correct": false}, {"label": "D", "text": "Varicella-zoster virus", "correct": true}], "correct_answer": "D. Varicella-zoster virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Varicella-zoster virus The clinical scenario describes a typical Chickenpox rash The incubation period is 10–21 days. Malaise and fever are the early symptoms, followed by the CENTRIPETAL rash, first on the trunk and then on the face, the limbs, and the buccal and pharyngeal mucosa in the mouth. Successive fresh vesicles appear in crops, so that all stages of macules, papules, vesicles, and crusts may be seen at one</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. small pox is eradicated Option B. parvovirus B19 causes slapped cheek appearance, not a multi-stages generalized rash Option C. EBV causes infectious mononucleosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Chickenpox is highly contagious to those who haven't had the disease or been vaccinated against it. The most characteristic symptom is an itchy, blister-like rash on the skin. The most common extracutaneous complication of chickenpox is in:", "options": [{"label": "A", "text": "CNS", "correct": true}, {"label": "B", "text": "Lungs", "correct": false}, {"label": "C", "text": "Kidneys", "correct": false}, {"label": "D", "text": "CVS", "correct": false}], "correct_answer": "A. CNS", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>CNS V aricella-zoster virus central nervous system infection can have various presentations, including encephalitis, meningitis, cranial neuropathies, vasculopathy, and myelitis. Central nervous system complications of primary VZV infection may occur, albeit very rarely. Reye syndrome, Guillain-Barré syndrome, acute cerebellar ataxia, and encephalitis have all been documented to occur after VZV infection. After the initial infection, the chickenpox virus resides in the ganglia along the spine and in the brain and later might cause the disease to shingles. Both shingles and chicken pox can lead to neurological complications such as encephalitis, meningitis, half single-sided facial paralysis and stroke.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Varicella (chickenpox) is an acute infectious disease. The following statements regarding varicella and zoster are true except for one:", "options": [{"label": "A", "text": "They are two diseases caused by one virus", "correct": false}, {"label": "B", "text": "Varicella is the primary illness, whereas zoster is the recurrent form of the disease", "correct": false}, {"label": "C", "text": "They have the same clinical picture", "correct": true}, {"label": "D", "text": "Varicella is a disease of children, whereas zoster is a disease of elderly and immunosuppressed patients", "correct": false}], "correct_answer": "C. They have the same clinical picture", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>They have the same clinical picture</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Herpes zoster, also known as shingles, is caused by the reactivation of the varicella-zoster virus (VZV), the same virus that causes varicella (chickenpox). Primary infection with VZV causes varicella. Varicella (chickenpox) is an acute infectious disease. It is caused by the varicella-zoster virus (VZV), which is a DNA virus that is a member of the herpesvirus group. Option B. After the primary infection, VZV stays in the body (in the sensory nerve ganglia) as a latent infection. Primary infection with VZV causes varicella. Option D. Varicella is characterized by fever concurrent with a self-limiting rash on the skin and sometimes mucosa. The rash begins as macules, and rapidly progresses to papules, followed by a vesicular stage and crusting of lesions. Varicella is a disease of children, whereas zoster is a disease of elderly and immunosuppressed patients Herpes zoster usually begins with a prodromal phase characterized by pain, itching, paresthesias (numbness or tingling), dysesthesias (unpleasant sensations), or sensitivity to touch (allodynia) in one to three dermatomes. So, Options A, B and D. Are the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Varicella (chickenpox) Fig 1 Varicella (chickenpox) is a mild, highly contagious disease, chiefly in children, characterized clinically by a generalized vesicular eruption of the skin and mucous membranes. The disease may be severe in adults and immunocompromised individuals. Herpes zoster (shingles) Fig 2 is a sporadic, disease of elderly or immunocompromised individuals that is characterized by pain and vesicular rash along the distribution to the skin innervated by a single sensory ganglion. The lesions are similar to those of varicella. Both diseases are caused by the same virus. Whereas varicella is an acute disease due to primary contact with the virus, zoster is the response of the partially immune host to reactivation of varicella virus present in latent form in neurons in sensory ganglia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Varicella (chickenpox) is an acute infectious disease. After entering the body via the respiratory tract, VZV varicella-zoster virus replicates in which of the following?", "options": [{"label": "A", "text": "Blood", "correct": false}, {"label": "B", "text": "Skin", "correct": false}, {"label": "C", "text": "Lymph nodes", "correct": true}, {"label": "D", "text": "Neurons", "correct": false}], "correct_answer": "C. Lymph nodes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lymph nodes It is postulated that within lymph nodes, VZV undergoes a period of replication, resulting in a primary cell-associated viremia, during which time the virus is transported to the reticuloendothelial organs, where it undergoes another period of replication that results in a secondary cell-associated viremia and virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Viral proliferation does not occur in the Option B. Zoster and Postherpetic Neuralgia The virus replicates in regional lymph nodes of the upper respiratory tract 2–4 days after initial infection and is followed by primary viremia on days 4–6. VZV enters through the respiratory tract and conjunctiva. The virus is believed to replicate at the site of entry in the nasopharynx and in regional lymph nodes. Options A, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 56-year-old woman is brought to the emergency department with a 5-day history of fever, facial pain, and headache and a 1-day history of epistaxis, visual disturbances, and increasing lethargy. Physical examination reveals a toxic-appearing woman with proptosis (forward bulging) of the left eye. Erosive lesions of the sinus and orbit are seen on the CT of the head. The culture of material from a sinus aspirate grew the organism seen in the photo. What underlying condition most likely predisposed the woman to this infection?", "options": [{"label": "A", "text": "Diabetes", "correct": true}, {"label": "B", "text": "Graves disease", "correct": false}, {"label": "C", "text": "HIV infection", "correct": false}, {"label": "D", "text": "Hypothyroidism", "correct": false}], "correct_answer": "A. Diabetes", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249748816-QTDV062003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diabetes The case describes an individual with rhinocerebral zygomycosis, a fungal infection involving the nasal cavity, sinuses, eye, and even the brain and meninges The fungi involved belong to the group Zygomycetes, which includes Rhizopus spp. and Mucor spp. among others. These organisms produce the characteristic sporangium seen in the photograph. These opportunistic fungi readily invade blood vessels, entering tissues and producing necrotic lesions. Infection with these organisms is rapidly progressive, with a high mortality rate despite appropriate treatment. The most common predisposing factor for this infection is diabetic ketoacidosis. Other predisposing conditions include persons with acidosis due to other causes such as renal failure or diarrhoea. Patients with solid organ transplants, haematological malignancies, or corticosteroid therapy are also at risk.</p>\n<p><strong>Highyeild:</strong></p><p>Rhinocerebral Mycosis In Diabetes</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B and D. No obvious association with thyroid Option C. This infection has been reported in HIV-infected patients. Poorly controlled diabetes is, however, the most important risk factor for this infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "During a medical mission, an infant with failure to thrive is evaluated. The mother indicates that the child has a poor appetite and is resistant to breastfeeding. A white pseudomembranous coating seen in the child’s mouth is shown in the photograph. A scraping of the material, observed under the microscope, is also shown. Which antimicrobial is the most appropriate treatment for this condition:", "options": [{"label": "A", "text": "Albendazole", "correct": false}, {"label": "B", "text": "Metronidazole", "correct": false}, {"label": "C", "text": "Nalidixic acid", "correct": false}, {"label": "D", "text": "Nystatin", "correct": true}], "correct_answer": "D. Nystatin", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249751467-QTDV062004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nystatin The child in this case has oral thrush due to an overgrowth of Candida. The lack of appetite is more than likely associated with dysphagia in this case. Thrush is common in children who are poorly nourished. Most commonly, the condition is self-limiting. Nystatin , the best first choice, will speed the healing process and allow the child to comfortably feed. None of the other choices listed in this question have antifungal activity.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Albendazole is used to treat neurocysticercosis , an infection of the nervous system caused by pork tapeworms. This medicine is also used to treat cystic hydatid disease of the liver, lung, and peritoneum, an infection caused by dog tapeworms. Option B. Metronidazole capsules and tablets are used to treat infections of the reproductive system, gastrointestinal (GI) tract, skin, heart, bone, joint, lung, blood, nervous system, and other areas of the body. Metronidazole capsules and tablets are also used to treat sexually transmitted diseases Option C . Alidixic Acid is used in the treatment of bacterial infections. It is also used in infections of the urinary tract , tonsils, sinus, nose, throat, female genital organ, skin & soft tissues and lungs (pneumonia). Nalidixic Acid is an antibiotic. It works by stopping the action of a bacterial enzyme called DNA-gyrase. So, Options B, C and A. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Oral candidiasis is an infection of the oral cavity by Candida albicans. The condition is generally obtained secondary to immune suppression, which can be local or systemic, including extremes of age (newborns and elderly), immunocompromising diseases such as HIV/AIDS, and chronic systemic steroid and antibiotic use.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old male presents with fever, headache, chills, cough, and chest pain a few weeks after visiting caves in the Ozark Mountains of northern Arkansas. A chest radiograph reveals patchy lung infiltrates and hilar lymphadenopathy. An immunodiffusion test detects antibodies in the patient’s serum to the H antigen of the causative fungal agent. Which organism caused the patient’s clinical manifestations?", "options": [{"label": "A", "text": "Candida albicans", "correct": false}, {"label": "B", "text": "Histoplasma capsulatum", "correct": true}, {"label": "C", "text": "Blastomyces dermatitidis", "correct": false}, {"label": "D", "text": "Coccidioides immitis", "correct": false}], "correct_answer": "B. Histoplasma capsulatum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Histoplasma capsulatum The case is descriptive of acute pulmonary histoplasmosis. This condition occurs following inhalation of large numbers of fungal spores of H. capsulatum. Caves inhabited by bats are examples of places in which exposure to H. capsulatum is a risk. Diagnosis of acute pulmonary histoplasmosis can best be accomplished by serology, using either immunodiffusion or complement fixation tests. Both tests can be used to detect antibodies in the patient's serum to either or both the M antigen and the H antigen of this organism. B. dermatitidis and Coccidioides immitis are also endemic dimorphic fungi that cause pulmonary symptoms. Option A- Candida albicans cause serious respiratory disease in the immune-compromised, thus would not be included in the differential for this patient.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A- Cryptococcus neoformans typically causes neurological disease in the immune compromised. Option C- Option D- So, Option A, C and D are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Symptoms of Histoplasmosis Fever Cough Fatigue (extreme tiredness) Chills Headache Chest pain. Body aches.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "While on a medical mission trip, you encounter a 35-year-old male who presents with a series of pruritic, warty papules (“cauliflower-like” lesions) which extend from the foot to the knee. You learn that this patient has had these lesions for some time and that he is employed by the region’s forest agency. Microscopy of the biopsied lesions reveals the presence of characteristic “muriform bodies” that are pigmented yeast-like cells. Which one of the following clinical syndromes most likely accounts for this clinical presentation?", "options": [{"label": "A", "text": "Zygomycosis", "correct": false}, {"label": "B", "text": "Sporotrichosis", "correct": false}, {"label": "C", "text": "Dermatophytosis", "correct": false}, {"label": "D", "text": "Chromoblastomycosis", "correct": true}], "correct_answer": "D. Chromoblastomycosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chromoblastomycosis Copper Penny Bodies Also Called As: Medlar Bodies Sclerotic Cell Seen In Chromoblastomycosis It's An Chronic Fungal Infection There are several clues to answer this question cauliflower-like lesions, patient employment with a forest agency, muriform bodies in the biopsy, etc. Chromoblastomycosis is a disfiguring disease occurring in rural areas of the tropics and is common among men seen on the arms and legs especially those working in the forest. It is transmitted by contact with woody plants and soil. The disease is caused by numerous fungal species, however, all of these form muriform bodies in the tissue lesions. These muriform bodies tend to be brown in colouration due to the presence of melanin in the cell walls. White piedra is soft mould growth on hairs in the groin area. Zygomycosis is similar to this disease in terms of gross disfiguring lesions, however, there is no cauliflowerlike Appearance.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B . Sporotrichosis is characterized by the development of skin ulcerations along a lymphatic pathway. Option C. Dermatophytosis represents the different tineas or ringworm infections characterized as erythematosus, annular, and scaling patches. So Options B, C And A are not the correct options:</p>\n<p><strong>Extraedge:</strong></p><p>Chromoblastomycosis is a chronic granulomatous infection of the skin and subcutaneous tissue caused by several different dematiaceous fungi (brown pigment-producing), resulting in the formation of slow-growing, warty plaques, cauliflower-like lesions which may ulcerate.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old male, HIV Patient with CD4+ count 50/uL, presented with diffuse skin lesions, hepatosplenomegaly and lymphadenopathy. Blood culture revealed the following findings. Which of the following organism is responsible for the patient's condition?", "options": [{"label": "A", "text": "Aspergillus flavus", "correct": false}, {"label": "B", "text": "Aspergillus fumigatus", "correct": false}, {"label": "C", "text": "Rhizopus", "correct": false}, {"label": "D", "text": "Penicillium marneffei", "correct": true}], "correct_answer": "D. Penicillium marneffei", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249751476-QTDV062007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Penicillium marneffei Microscopy of the mould form of P. marneffei showing septate hyaline hyphae and fruiting structures in a characteristic paintbrush appearance suggestive of Penicillium marneffi. Granular colony of P. marneffei with a characteristic Red diffusible pigment on Sabouraud’s dextrose agar</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- All other fungi do not release red pigment and do not have a paintbrush appearance. Option A Option B Option C</p>\n<p><strong>Extraedge:</strong></p><p>Talaromycosis is an infection caused by the fungus Talaromyces marneffei. The name of the fungus and the name of the infection have changed. T. marneffei used to be called Penicillium marneffei, and talaromycosis used to be called penicilliosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The organism producing the following lesions are characterized by causing which of the the following?", "options": [{"label": "A", "text": "Superficial mycoses", "correct": false}, {"label": "B", "text": "Deep subcutaneous mycoses", "correct": true}, {"label": "C", "text": "Systemic mycoses", "correct": false}, {"label": "D", "text": "Opportunistic mycoses", "correct": false}], "correct_answer": "B. Deep subcutaneous mycoses", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249757076-QTDV062008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Deep subcutaneous mycoses The given image is subcutaneous swelling with multiple discharging sinuses suggestive of madura foot or maduramycosis caused by mycetoma . It is deep or subcutaneous mycosis which involves skin and subcutaneous tissue. So, Option A, C and D are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following organism shows the phenomenon depicted in the image when added to serum:", "options": [{"label": "A", "text": "Candida albicans", "correct": true}, {"label": "B", "text": "Candida tropicalis", "correct": false}, {"label": "C", "text": "Cryptococcus neoformans", "correct": false}, {"label": "D", "text": "Both a and b", "correct": false}], "correct_answer": "A. Candida albicans", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249757408-QTDV062010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida albicans Candida albicans species only produce germ tubes in serum Known as the Reynolds-Braude phenomenon. --> candida dubliniensis is also associated with the production of Germ tubes but cannot grow at 42 degrees Celsius, unlike Candida albicans.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. non-albicans species of candida like candida tropicalis do not produce germ tubes in serum. Therefore, the germ tube test is useful for differentiating between candida albicans and candida non-albicans. Option C. cryptococcus neoformans is a capsulated fungus causing meningitis in HIV-positive and immunocompromised individuals. So, Options B, C and D are not the correct options. So, Options B, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 44-year-old male patient presented with a 3-month history of cough, hemoptysis and 7 kg weight loss. He worked as a builder and smoked 40 cigarettes/day for 20 years. Initial investigations revealed a leucocyte count of 8.6×109/L, fasting blood glucose of 130mg/dl, serum albumin of 5g/dl, HIV testing was negative and normal arterial blood gases on room air. Sputum microbiology was negative. The patient was initially prescribed third-generation cephalosporins for pneumonia but failed to improve. A chest CT scan showed a mass, 67.7 mm in diameter in the right upper lobe and 72.4 mm in diameter in the right hilar, with evidence of narrowing of the right upper lobe bronchus. Bronchoscopy confirmed a mass over the right main bronchus orifice that caused occlusion. Because of the risk of bleeding, the mass wasn’t biopsied. A biopsy specimen was taken from the mass located in the posterior segment of the right upper lobe by lung puncture biopsy which revealed a capsulated organism as shown in the image below. Which of the following is a causative organism?", "options": [{"label": "A", "text": "Cryptococcus neoformans", "correct": true}, {"label": "B", "text": "Streptococcus pneumoniae", "correct": false}, {"label": "C", "text": "Klebsiella pneumoniae", "correct": false}, {"label": "D", "text": "Pneumocystis jiroveci", "correct": false}], "correct_answer": "A. Cryptococcus neoformans", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249758269-QTDV062011IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptococcus neoformans Cryptococcus neoformans is a capsulated fungus & classified as yeast. It can cause pulmonary cryptococcosis & cryptococcal meningitis. It can be stained by fungal stains as shown in the image above</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Pneumococci are capsulated gram-positive cocci (bacteria) causing bacterial pneumoniae Option C. Klebsiella pneumoniae is gram-negative, capsulated bacteria causing pneumoniae & are characteristic of producing red currant jelly sputum. Option D. Pneumocystis jiroveci is one of the most common organisms causing pneumonia in HIV-positive individuals So, Options B, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Cryptococcus is an invasive fungus that causes cryptococcosis an infection commonly associated with immunosuppressive individuals while being rare in healthy individuals. The two species of Cryptococcus that are commonly associated with infections in humans are Cryptococcus neoformans and Cryptococcus gatti.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 82-year-old male was admitted with a one-month history of swelling and small pustules that progressed to ulcers with purulent drainage in his right hallux. Medical history includes recurrent gout attacks since 8 years ago, hypertension, diabetes mellitus, hypothyroidism, chronic kidney failure in medical management, aortic valve replacement, and myocardial revascularization. A plain radiograph of the foot revealed a lytic lesion with cortical disruption in the proximal phalanx of the right hallux associated with soft tissue swelling. Laboratory studies showed PCR polymerise chain reactions of 4.47 mg/dL (0–0.5 mg/dL), BUN 42 mg/dL (8–23 mg/dL), serum creatinine of 1.7 mg/dL, TSH thyroid stimulating hormone level of 6.4 mIU/L, albumin 2.6 g/dL, white blood cell count of 8 × 103/uL with a normal differential, haemoglobin of 11.2 g/dL, hematocrit of 35%, and platelets of 390.000 K/uL. The HIV test was negative. Blood and urine cultures were reported as negative. Amputation of the hallux was done. The microbiology laboratory received the sample of drainage right hallux for bacteriological study, to which Gram stain was initially performed and fungal structures were observed like large, round, fairly thick-walled cells with single and multiple buddings. Direct examination, with KOH 10%, observed unique spherical yeast budding with Mickey Mouse appearance or pilot wheel appearance & culture microscope at 25-degrees Celsius shows models with pear-shaped conidia. Which of the following is the causative organism of the patient’s condition?", "options": [{"label": "A", "text": "Paracoccidioides", "correct": true}, {"label": "B", "text": "Blastomycoses", "correct": false}, {"label": "C", "text": "Histoplasmosis", "correct": false}, {"label": "D", "text": "Coccidioidomycosis", "correct": false}], "correct_answer": "A. Paracoccidioides", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249758960-QTDV062019IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Paracoccidioides Paracoccidioides are dimorphic fungi characterized by the production of a pilot wheel appearance are Mickey Mouse appearance of the east cell on the sample microscope. At 25-degree Celsius, the culture microscope shows moulds characterized by pear shape conidia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Histoplasmosis Histoplasmosis is caused by Histoplasma capsulatum which mainly involves the reticuloendothelial system . -->Simple microscopy shows intracellular budding yeast cells and is present within macrophages. At 25 degree Celsius, the culture microscope shows trabeculated conidia. Option B. Blastomycoses Blastomycosis is caused by Blastomyces dermatitidis which is a dimorphic fungus and is characterized by producing yeast cells with broad-based budding on sample microscopy And a culture microscope at 25 degrees Celsius moulds with pear-shaped conidia can be seen. Option: D. Coccidioidomycosis Coccidioidomycosis is responsible for systemic or endemic mycosis Simple microscope please show yeast cells with spherules and endospores within. 25-degree Celsius culture microscopy shows fragmented septate hyphae due to rectangular shape conidia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 83-year-old female with a previous history of arterial hypertension, atrial flutter and chronic obstructive pulmonary disease presented with dry cough (~2 weeks), fever (102ºF), and cutaneous ulcerated plaques with elevated borders on forearm, foot, leg, and neck. Chest radiographs and chest CT scans showed numerous bilateral nodular consolidations compatible with pneumonia. Additionally, mild leukocytosis (14,200 cells /mm3) and hypo hemoglobinemia (10.9 mg/dl) were documented. A skin biopsy was taken from the forearm lesion. Periodic acid–Schiff (PAS) and Gomori methenamine silver (GMS) stains identified characteristic budding yeast cells showing a figure of 8 appearances. culture microscope at 25 degrees Celsius shows models with pear-shaped conidia. Which of the following is the causative organism of the patient’s condition?", "options": [{"label": "A", "text": "Paracoccidioides", "correct": false}, {"label": "B", "text": "Blastomycosis", "correct": true}, {"label": "C", "text": "Histoplasmosis", "correct": false}, {"label": "D", "text": "Coccidioidomycosis", "correct": false}], "correct_answer": "B. Blastomycosis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689249762080-QTDV062020IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Blastomycosis B lastomycosis is caused by Blastomyces dermatitidis which is a dimorphic fungus and is characterized by producing yeast cells with broad-based budding on sample microscopy. And a culture microscope at 25 degrees Celsius moulds with pear-shaped conidia can be seen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: A. Paracoccidioides Paracoccidioides are dimorphic fungi characterized by the production of a pilot wheel appearance are Mickey Mouse appearance of the east cell on the sample microscope. At 25-degree Celsius culture microscope it shows moulds characterized by pear shape conidia Option C. Histoplasmosis Histoplasmosis is caused by Histoplasma capsulatum which mainly involves the reticuloendothelial system . Simple microscope e shows intracellular budding yeast cells present within the At 25 degrees Celsius, the culture microscope shows trabeculated conidia. Option D. Coccidioidomycosis Coccidioidomycosis is responsible for systemic or endemic mycosis. Simple microscopy shows yeast cells with spherulesles and endospores within. 25-degree Celsius culture microscopy shows fragmented septate hyphae due to rectangular shape conidia</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Mucormycosis is a serious but rare fungal infection caused by a group of moulds called mucormycetes. These moulds live throughout the environment. Mucormycosis mainly affects people who have health problems or take medicines that lower the body's ability to fight germs and sickness. Each of the following statements concerning mucormycosis is correct EXCEPT:", "options": [{"label": "A", "text": "Ketoacidosis in diabetic patients is a predisposing factor to mucormycosis.", "correct": false}, {"label": "B", "text": "Tissue sections from a patient with mucormycosis show broad septate hyphae.", "correct": true}, {"label": "C", "text": "The fungi that cause mucormycosis are transmitted by airborne asexual spores.", "correct": false}, {"label": "D", "text": "Hyphae typically invade blood vessels and cause necrosis of tissue", "correct": false}], "correct_answer": "B. Tissue sections from a patient with mucormycosis show broad septate hyphae.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tissue sections from a patient with mucormycosis show broad septate hyphae. A tissue section from a patient with mucormycosis shows non-septate broad ribbon-like hyphae. Mucormycosis is an infection caused by several related moulds. Mucormycosis is acquired when spores produced by the mould are inhaled or, much less commonly, when they enter the body through a cut or other break in the skin. The infection causes pain, fever, and sometimes cough and can destroy structures in the face.</p>\n<p><strong>Highyeild:</strong></p><p>Mucormycosis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Mucormycosis previously called zygomycosis is a serious but rare fungal infection caused by a group of moulds called mucormycetes and transmitted by airborne asexual spores. Option A. Mucormycosis mainly affects people who have health problems like diabetes or take medicines that lower the body's ability to fight germs and sickness. Option D. Clinical hallmarks of mucormycosis infections include the unique susceptibility of patients with increased available serum iron, the propensity of the organism to invade blood vessels, and defective phagocytic function. So, Options A, C and D. Are correct statements regarding mucormycosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An obese 32-year-old diabetic woman presents with a complaint of red and painful skin in her abdominal skin folds. Examination reveals a creamy white material at the base of the fold. Microscopic examination of the exudates reveals oval budding structures. The most likely causative agent is:", "options": [{"label": "A", "text": "A. fumigatus", "correct": false}, {"label": "B", "text": "C. albicans", "correct": true}, {"label": "C", "text": "E. floccosum", "correct": false}, {"label": "D", "text": "M. canis", "correct": false}], "correct_answer": "B. C. albicans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. albicans The yeast Candida is said to be dimorphic in that it can grow as an oval, budding yeast, but under certain culture conditions, the budding yeast may elongate and remain attached producing filament-like structures called pseudohyphae. albicans may also produce true hyphae similar to moulds. It is capable of vegetative growth in vitro and in vivo as ovoid budding yeast-like cells and as branching filamentous cells that exist. Candida albicans is a pleiomorphic fungus, with three different vegetative growth forms: yeast, pseudo hyphae and true hyphae. In contrast, bakers' yeast Saccharomyces cerevisiae exhibits either unicellular budding or pseudo mycelial growth but does not form parallel-sided unconstructed true hyphae.</p>\n<p><strong>Highyeild:</strong></p><p>Different Species of Candida on Chrom Agar Candida species Color on CHROMagar Candida albicans Light green Candida dubliniensis Dark green Candida glabrata Pink to purple Candida krusei Pink Candida parapsilosis Cream to pale pink Candida tropicalis Blue with a pink halo</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. fumigatus causes a wide range of infections, including chronic lung disease (chronic pulmonary aspergillosis) and life-threatening systemic infection that can involve multiple organs (invasive aspergillosis). Option C. Epidermophyton is a genus of fungus causing superficial and cutaneous mycoses , including E. floccosum, and causes tinea corporis (ringworm), tinea cruris (jock itch), tinea pedis (athlete's foot), and tinea unguium (fungal infection of the nail bed). Option D. Microsporum canis produces infections of the scalp and body sites, creating highly inflammatory lesions associated with hair loss. So, Options A, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A gardener with multiple vesicles on hand and along lymphatics. The fungus responsible for the characteristic lesions would be?", "options": [{"label": "A", "text": "Cladosporium", "correct": false}, {"label": "B", "text": "Sporothrix", "correct": true}, {"label": "C", "text": "Histoplasma", "correct": false}, {"label": "D", "text": "Candida", "correct": false}], "correct_answer": "B. Sporothrix", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sporothrix Sporothrix is a ubiquitous genus of soil-dwelling fungus. The first described and best-known species is Sporothrix schenckii, the causative agent of rose handler's disease. Sporotrichosis also known as “rose gardener's disease” is an infection caused by a fungus called Sporothrix. This fungus lives throughout the world in soil and on plant matter such as sphagnum moss, rose bushes, and hay. The first symptom of sporotrichosis is a firm bump (nodule) on the skin that can range in colour from pink to nearly purple. The nodule is usually painless or only mildly tender . Over time, the nodule may develop an open sore (ulcer) that may drain clear fluid.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Rhinosporidiosis is a rare, infectious, chronic granulomatous disease caused by Rhinosporidium seeberi, an endosporulating microorganism. It has recently been classified in the taxonomic group, mesomycetozoea, which is a group of microorganisms at the boundary between fish and fungi. In India, Rhinosporidiosis is prevalent in:", "options": [{"label": "A", "text": "Assam", "correct": false}, {"label": "B", "text": "Tamil Nadu", "correct": true}, {"label": "C", "text": "Punjab", "correct": false}, {"label": "D", "text": "Gujarat", "correct": false}], "correct_answer": "B. Tamil Nadu", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tamil Nadu Rhinosporidiosis is a granulomatous disease affecting the mucous membrane of the nasopharynx, oropharynx, conjunctiva, rectum and external genitalia. Though the floor of the nose and inferior turbinate are the most common sites, the lesions may appear elsewhere too. Traumatic inoculation from one site to others is common. Rhinosporidiosis is a chronic granulomatous infection of the mucous membranes that usually manifests as vascular friable polyps that arise from the nasal mucosa or external structures of the eye. Granulomatous mass involving structures of the eye. Rhinosporidiosis is endemic in the Kanyakumari district of Tamilnadu India. Common site of involvement was the nasal cavity and nasopharynx.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following fungi is believed to originate in stagnant water-", "options": [{"label": "A", "text": "Sporothrix", "correct": false}, {"label": "B", "text": "Cladosporium", "correct": false}, {"label": "C", "text": "Rhinosporidium", "correct": true}, {"label": "D", "text": "Cryptococcus", "correct": false}], "correct_answer": "C. Rhinosporidium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rhinosporidium Rhinosporidium seeberi is a eukaryotic pathogen responsible for rhinosporidiosis , a disease which affects humans, horses, dogs, and to a lesser extent cattle, cats, foxes, and birds. It is most commonly found in tropical areas, especially India and Sri Lanka. Rhinosporidium lives in soil and it is believed that water is a necessary medium of transmission . Infection usually results from a local traumatic inoculation and is associated with water activities e.g. swimming in stagnant water. The infection is typically limited to the mucosal epithelium. Most reported cases show an association of rhinosporidiosis occurring in individuals with contact with stagnant, contaminated water, which may be due to watery substance stimulating endospore release. The infection occurs from inoculation of a site with R. seeberi in the form of endospores .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Hilly areas - gardners via thorn injury Option B. Cladosporium is a genus of fungi including some of the most common indoor and outdoor mou Species produce olive-green to brown or black colonies</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Reynold-Braude phenomenon is characteristic of which of the following?", "options": [{"label": "A", "text": "Candida", "correct": true}, {"label": "B", "text": "Dermatophytes", "correct": false}, {"label": "C", "text": "Blastomycosis", "correct": false}, {"label": "D", "text": "Cryptococcosis", "correct": false}], "correct_answer": "A. Candida", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida The Germ Tube Test, also known as the \"Reynold Braude\" phenomenon, is a screening procedure which is used for the identification and differentiation of Candida albicans. Candida produces Chlamydospore, Germ tube within 2 hours when incubated in human serum. Germ tube formation was first reported by Reynolds and Braude and hence the germ tube test is also known as Reynolds-Braude Phenomenon. Germ tube (GT) formation was first reported by Reynolds and Braude in 1956. When Candida is grown in human or sheep serum at 37°C. Germ tube test is the confirmatory test for Candida albicans. Germ tube formation was first reported by Reynolds and Braude and hence the germ tube test is also known as Reynolds-Braude Phenomenon. This is a rapid method for identifying and differentiating C. albicans from other Candida spp.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A HIV-positive female presents with an indurated ulcer over the tongue. Laboratory findings show growth in cornmeal agar at 20dgreeCelsius, microscopy showing hyphae and growth in human serum at 37 degree Celsius showing budding yeasts. The probable cause is?", "options": [{"label": "A", "text": "Candida albicans", "correct": true}, {"label": "B", "text": "Histoplasmosis", "correct": false}, {"label": "C", "text": "Blastomycosis", "correct": false}, {"label": "D", "text": "Coccidioidomycosis", "correct": false}], "correct_answer": "A. Candida albicans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida albicans Candida albicans is an opportunistic pathogenic yeast that is a common member of the human gut flora . It can also survive outside the human body. It is detected in the gastrointestinal tract and mouth in 40-60 per cent of healthy adults. The most common opportunistic fungal infection in HIV-positive patients is candidiasis, affecting the mucocutaneous system mainly but the invasive form is also common. Resistance to azoles and other antifungal agents in the Candida species is a point of concern. Candidiasis is a yeast infection caused by Candida albicans. In people with HIV, the virus that causes AIDS, candidiasis commonly affects the skin and mucous membranes such as the mouth, throat, esophagus and vagina.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B Option C Option D Options B, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pneumocystis jiroveci is a fungus - this statement can be validated with the help of which of the following ?", "options": [{"label": "A", "text": "rRNA and mitochondrial protein gene sequencing", "correct": true}, {"label": "B", "text": "Antifungals are effective against it", "correct": false}, {"label": "C", "text": "Commonest infection in AIDS", "correct": false}, {"label": "D", "text": "Mould-like morphology", "correct": false}], "correct_answer": "A. rRNA and mitochondrial protein gene sequencing", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>rRNA and mitochondrial protein gene sequencing Pneumocystis jiroveci is a yeast-like fungus of the genus Pneumocystis. The causative organism of Pneumocystis pneumonia , it is an important human pathogen, particularly among immunocompromised Prior to its discovery as a human-specific pathogen, jiroveci was known as P. carinii. Pneumocystis jiroveci is one of the common opportunistic infections in humans. The 5.8S rRNA sequences of 23 types of P. jiroveci. Pneumocystis jiroveci, a transmissible fungus, is the causative agent of pulmonary infections.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Antifungals are effective against it - can’t validate it as a fungus Option C. Commonest infection in AIDS - can’t validate it as a fungus Option D. Mould-like morphology - can’t validate it as a fungus Options B, C and D. Are not the correct options to prove pneumocystis is a fungus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Allergic bronchopulmonary aspergillosis (ABPA) is a fungal infection of the lung due to a hypersensitivity reaction to antigens of Aspergillus fumigatus after colonization into the airways. Predominantly it affects patients with bronchial asthma and those having cystic fibrosis. The following are the main diagnosis criteria for allergic bronchopulmonary aspergillosis except?", "options": [{"label": "A", "text": "Pulmonary infiltrates", "correct": false}, {"label": "B", "text": "Distal bronchiectasis", "correct": true}, {"label": "C", "text": "Peripheral eosinophilia", "correct": false}, {"label": "D", "text": "Bronchial asthma", "correct": false}], "correct_answer": "B. Distal bronchiectasis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Distal bronchiectasis Bronchiectasis is a disease in which there is permanent enlargement of parts of the airways of the lung. Symptoms typically include a chronic cough with mucus production . Other symptoms include shortness of breath, coughing up blood, and chest pain. Wheezing and nail clubbing may also occur. Allergic Bronchopulmonary Aspergillosis (ABPA) is an allergic or hypersensitive reaction to a fungus known as Aspergillus fumigatus. This is a fungus found in the soil. Although most of us are frequently exposed to Aspergillus, a reaction to it is rare in people with normal immune systems The two features of the obligatory criteria are Positive immediate (type I) cutaneous hypersensitivity to Aspergillus antigen or elevated IgE levels against A. fumigatus, and Elevated total IgE levels >1000 IU•mL−1. It is essential that both these findings should be present to achieve a diagnosis of ABPA.</p>\n<p><strong>Highyeild:</strong></p><p>Criteria of Abpa Diagnosis and diagnostic criteria The Rosenberg-Patterson criteria (10): Major criteria (mnemonic ARTEPICS): A-Asthma R-Radiographic fleeting pulmonary opacities T-skin Test positive for aspergillus (type I reaction, immediate cutaneous hypersensitivity) E-Eosinophilia P-Precipitating antibodiers (IgG) in serum I-IgE in serum elevated (1,000 IU/MI) C-Central bronchiectasis S-Serum A fumigatus-specific IgG and IgE (> twice the value of pooled serum sample from patients with asthma who have Aspergillus hypersensitivity by skin test)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Symptoms typically include a chronic cough with mucus production. Other symptoms include shortness of breath, coughing up blood, and chest pain. Pulmonary infiltrates are present Option C. At least two out of three other criteria should be fulfilled: The presence of precipitating or IgG antibodies against A. fumigatus in serum, Radiographic pulmonary opacities consistent with ABPA, and A total eosinophil count >500 cells•μL−1 in steroid naïve patients. - Options A, C and D. Are not the correct options as they all are among the diagnostic criteria for ABPA.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In a patient, corneal scraping reveals narrow angled septate hyphae, which of the following is likely an etiologic agent?", "options": [{"label": "A", "text": "Mucor", "correct": false}, {"label": "B", "text": "Aspergillus", "correct": true}, {"label": "C", "text": "Histoplasma", "correct": false}, {"label": "D", "text": "Candida", "correct": false}], "correct_answer": "B. Aspergillus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus Aspergillus is a genus consisting of a few hundred mould species found in various climates. Aspergillus is a filamentous, cosmopolitan and ubiquitous COMMON TO ALL SPECIES: Hyphae are septate and hyaline hyphomycete. Aspergillus is a hyaline hyphomycete characterized by septate, narrow (3 to 6 µm) hyphae with acute angle (45 degrees) branching.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Broad, aseptate, irregular, ribbon-like hyphae. Option C. Generally small yeast cells (2-4 um in length), thick-walled and ovoid with a narrow base at the smaller end, whereas variants are found predominantly in Africa. Option D. Clinical candidiasis is a manifestation of the adherence of yeast cells to mucosal tissue followed by hyphal invasion causing extensive damage, partly mediated by secreted proteolytic enzymes.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cryptococcus is the most common fungus that causes serious infection worldwide. If you breathe the fungus in, it infects your lungs. The infection may go away on its own, remain in the lungs only, or spread throughout the body. Pathogenic Cryptococcus differs from non-pathogenic Cryptococcus by:", "options": [{"label": "A", "text": "Urease positive", "correct": false}, {"label": "B", "text": "Fast growth at 37C", "correct": true}, {"label": "C", "text": "Primary inhabitant of soil", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "B. Fast growth at 37C", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Fast growth at 37C Pathogenic cryptococci have a characteristic fast growth at 37 degrees C.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Cryptococcus gattii possesses a variety of well-characterized virulence factors, such as polysaccharide (PS) capsule formation, melanin production and growth at 37°Cneoformans is AIDS, whereas infections caused by C. gattii are more often reported in immunocompetent patients with undefined risk than in the immunocompromised. However, capsules are not limited to these pathogenic species as they are common in the Cryptococcus genus. While this species is most frequently found in water and plants and is also found on animal and human skin, it is not a frequent human pathogen. Option C. Both pathogenic and non-pathogenic cryptococcus are primary inhabitants of the soil. Options A & C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the most common agent in paranasal sinus mycoses:", "options": [{"label": "A", "text": "Aspergillus", "correct": true}, {"label": "B", "text": "Histoplasma", "correct": false}, {"label": "C", "text": "Conidiobolus coronatus", "correct": false}, {"label": "D", "text": "Candida albicans", "correct": false}], "correct_answer": "A. Aspergillus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus Aspergillus is a fungus whose spores are present in the air we breathe but does not normally cause illness. In those people with a weakened immune system, damaged lungs or with allergies, Aspergillus can cause disease. Fungal infections of the nose and paranasal sinuses are uncommon, and the disease they cause can be identified from their histopathologic appearance. Aspergillus flavus was the most common isolate. Surgical debridement and sinus ventilation were adequate for the effective management of the non-invasive disease. However, adjuvant medical therapy was included in the treatment of the semi-invasive and invasive varieties of the disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Histoplasmosis is an infection caused by a fungus called Histoplasma. The fungus lives in the environment , particularly in soil that contains large amounts of bird or bat droppings. Option C. Conidiobolus coronatus is a saprotrophic fungus,[1] first described by Costantin in 1897 as Boudierella coronata.[2] Though this fungus has also been known by the name Entomophthora coronata, the correct name is Conidiobolus coronatus Option D. Candida albicans is an opportunistic pathogenic yeast that is a common member of the human gut flora. It can also survive outside the human body. So, Options C, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Diphtheria is a serious infection caused by Corynebacterium diphtheriae. It can lead to difficulty breathing, heart failure, paralysis, and even death. Confirmatory test for diphtheria:", "options": [{"label": "A", "text": "Gram stain", "correct": false}, {"label": "B", "text": "Serological tests", "correct": false}, {"label": "C", "text": "Isolation in selective media", "correct": false}, {"label": "D", "text": "Tests for toxin", "correct": true}], "correct_answer": "D. Tests for toxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tests for toxin Diphtheria is a condition with toxemia. Since d iptheriae can produce toxins because of the presence of phage, toxigenicity tests are the final confirmatory tests for the pathogenicity of the bacterium.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, C. Gram stain & Isolation in selective media give a presumptive diagnosis. Carrying the bacteria need not be confirmative of its toxicity. Option B. Serological tests are also not specific for diagnosing diphtheria.</p>\n<p><strong>Extraedge:</strong></p><p>Elek’s Gel Precipitation Test: Detection Of C. Diphtheriae Toxicity Modified Elek immunoprecipitation method A filter paper disk containing antitoxin (10 IU/disk) is placed on an agar plate. The cultures to be tested (at least ten colonies should be chosen) for toxigenicity are spot inoculated 7–9 mm away from the disk. After 48 hours of incubation, the antitoxin diffusing from the paper disk precipitated the toxin diffusing from toxigenic cultures. It has resulted in precipitin bands between the disk and the bacterial growth.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old child presents with fever and cervical lymphadenopathy. Oral examination shows a gray membrane on the right tonsil. Which of the following will be ideal for rapid identification of the pathogen:", "options": [{"label": "A", "text": "Nutrient agar", "correct": false}, {"label": "B", "text": "Blood agar", "correct": false}, {"label": "C", "text": "Loeffler’s serum slope", "correct": true}, {"label": "D", "text": "Lowenstein Jensen medium", "correct": false}], "correct_answer": "C. Loeffler’s serum slope", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Loeffler’s serum slope History suggests Corynebacterium diphtheria infection, which needs to be ruled out. Cultural Characteristic: Aerobe and facultative anaerobe, optimum temp: 37°c. LSS- Colonies form in 6-8 hrs. IT IS A SELECTIVE NUTRIENT DEFICIENT MEDIA USED to enhance the granule formation by C . diphtheriae . No growth in simple media Growth is improved by serum/blood.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A & B. Are not selective for the said bacteria. A throat swab is a non-sterile The flora may overgrow, and the pathogen is lost in such a case. Option D. LJ media is used for mycobacterium spp. culture.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A combination of cervical adenopathy and swollen mucosa imparts a \"bull's neck\" appearance to many infected patients. Bull’s neck is characteristically seen in:", "options": [{"label": "A", "text": "Hamartoma of Lung", "correct": false}, {"label": "B", "text": "Diphtheria", "correct": true}, {"label": "C", "text": "Glaucoma", "correct": false}, {"label": "D", "text": "Hepatic Candidiasis", "correct": false}], "correct_answer": "B. Diphtheria", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diphtheria When diphtheritic inflammation begins in the respiratory tract, sore throat and low-grade fever usually develop. Prostration and dyspnea can occur because of the obstruction caused by the membrane. This obstruction may even cause suffocation if not promptly relieved by intubation or tracheostomy. Irregularities of cardiac rhythm indicate damage to the heart. Bull’s neck may be seen due to severe cervical lymphadenopathy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, D & C. Are incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 13 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 25-year-old woman comes to the emergency department due to 2 days of abdominal pain and bloody diarrhea. A few days ago, she attended a church barbeque party. The patient lives alone and has no medical problems. She does not know if anyone else at the party developed similar symptoms. Her temperature is 37.1 C (98.8 F), blood pressure is 119/76 mm Hg, pulse is 92/min, and respirations are 16/min. There is abdominal tenderness with no rebound or guarding. Guaiac-positive bloody stools are detected on rectal examination. Stool cultures reveal an Escherichia coli strain that does not produce glucuronidase and does not ferment sorbitol on sorbitol-containing MacConkey agar. Which of the following best describes the mechanism of action of the toxin produced by these bacteria?", "options": [{"label": "A", "text": "Activates adenylate cyclase", "correct": false}, {"label": "B", "text": "Activates guanylate cyclase", "correct": false}, {"label": "C", "text": "Disrupts the cellular cytoskeleton", "correct": false}, {"label": "D", "text": "Inactivates ribosomal subunits", "correct": true}], "correct_answer": "D. Inactivates ribosomal subunits", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inactivates ribosomal subunits</p>\n<p><strong>Highyeild:</strong></p><p>Enterohemorrhagic Escherichia coli (EHEC) O157:H7 can cause hemorrhagic colitis , most characteristically following ingestion of inadequately cooked hamburger meat. In contrast to most E coli strains, O157:H7 E coli does not ferment sorbitol during overnight incubation. As a result, sorbitol-containing MacConkey agar is used for isolation. Also, unlike other E coli strains, E coli O157:H7 does not produce glucuronidase . EHEC elaborates a Shiga-like toxin virtually identical to the Shiga toxin produced by Shigella dysenteriae . This toxin is phage-encoded, and its production is enhanced by iron deficiency. The Shiga and the Shiga-like toxins inactivate the 60s ribosomal subunit in human cells, leading to an inhibition of protein synthesis and eventual cell death. Infection with EHEC can also lead to hemolytic-uremic syndrome, characterized by thrombocytopenia, microangiopathic hemolytic anemia, and renal insufficiency (sometimes with uremia). Unlike Entero invasive E coli, EHEC does not invade the intestinal mucosa. Unlike enterotoxigenic E coli (ETEC), EHEC does not produce a heat-labile toxin (LT) or heat-stable toxin (ST).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Toxins produced by Bordetella pertussis (adenylate cyclase toxin), ETEC (LT), Campylobacter jejuni (C jejuni enterotoxin), and Vibrio cholerae (choleragen toxin) result in increased intracellular cyclic AMP in intestinal mucosal cells, which leads to decreased absorption and increased secretion of sodium, chloride, and water. Option B. ETEC (ST) and Yersinia enterocolitica (Y enterocolitica enterotoxin) produce toxins that increase intracellular cyclic GMP , leading to watery diarrhea and electrolyte loss. Option C. Clostridium difficile produces an exotoxin capable of disrupting the cytoskeleton (toxin B/cytotoxin). This toxin acts by depolymerizing actin, leading to cell death.</p>\n<p><strong>Extraedge:</strong></p><p>perfringens type C infection, and causes necrotizing enteritis and enterocolitis. In the disease process, C. perfringens penetrates the upper jejunum between absorptive cells and releases beta toxin. Beta toxin causes necrosis of the villi and mucosa, often causing blood loss into the lumen and intestinal wall.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old previously healthy girl is brought to the office due to diarrhea and abdominal pain. She started having watery diarrhea after a barbeque dinner 4 days ago; her stools became grossly bloody 2 days later. Her mother also had similar symptoms. The patient's temperature is 37 C (98.7 F). The abdomen is soft with mild generalized tenderness. A stool culture is performed on sorbitol-MacConkey agar and reveals sorbitol-negative colonies with biochemical properties of Escherichia coli. Enzyme immunoassay detects a substance capable of inhibiting protein synthesis in human cells. The substance detected in this patient is most similar to the toxin produced by which of the following bacteria?", "options": [{"label": "A", "text": "Clostridium difficile", "correct": false}, {"label": "B", "text": "Proteus mirabilis", "correct": false}, {"label": "C", "text": "Shigella dysenteriae", "correct": true}, {"label": "D", "text": "Salmonella typhi", "correct": false}], "correct_answer": "C. Shigella dysenteriae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Shigella dysenteriae Shiga-like toxins (Stx) (Vero cytotoxins [VT]) are produced by enterohemorrhagic Escherichia coli. Stx-1 (VT1) can inhibit protein synthesis in human cells and is closely related to the Shiga toxin produced by Shigella dysenteriae . It is an AB toxin (active A subunit and 5 binding B subunits). The plasmid coding for it is transmitted by a temperate bacteriophage. The B subunits, which form pentamers with a central pore, recognize specific recept ors on target cells and induce receptor-mediated endocytosis and toxin internalization. Subsequently, the enzymatically active A subunit is released and catalyzes the removal of a specific adenine residue, thereby preventing tRNA binding to the 60S ribosomal subunit and inhibiting protein synthesis. This leads to intestinal mucosal cell death and direct toxicity to renal epithelial cells.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenesis and Virulence Factors (cont.) Shiga Toxin Effects in Shigellosis (cont.) Cytotoxic Effect: ➤B subunit of Shiga toxin binds host cell glycolipid A domain is internalized via receptor-mediated endocytosis (coated pits) Causes irreversible inactivation of the 60S ribosomal subunit, thereby causing: Inhibition of protein synthesis . Cell death Microvasculature damage to the intestine Hemorrhage (blood & fecal leukocytes in stool) Neurotoxic Effect: Fever, abdominal cramping are considered signs of neurotoxicity</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Clostridium difficile produces toxin A (enterotoxin) and toxin B (cytotoxin) and causes pseudomembranous colitis, most commonly in patients recently treated with antibiotics. Toxin B depolymerizes actin filaments, causing gastrointestinal mucosal cell death. Option B. Proteus mirabilis does not produce toxins. Option D. Salmonella typhi (cause of typhoid fever) enters the human digestive tract orally, penetrates the intestinal mucosa, and travels to mesenteric lymph nodes, where it multiplies and is phagocytosed by macrophages within which it can survive. Typhoid fever is characterized by fever, abdominal pain, diarrhea and/or constipation, and faintly erythematous macules on the abdomen (\"rose spots\").</p>\n<p><strong>Extraedge:</strong></p><p>There are two major members of the Shiga toxin family, Shiga toxin 1 (Stx1), which is essentially identical to the Shiga toxin produced by Shigella, and Shiga toxin 2 (Stx2), which has only 56% homology with Stx1 and which is immunologically distinct (2).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 8-year-old boy is brought to the emergency department due to 2 days of fever, abdominal pain, and diarrhea. The patient has no significant medical history and has received all recommended vaccinations. He attends a primary school and has not traveled recently. The family recently brought home a new puppy from a kennel. The patient's stool is positive for occult blood but negative for ova and parasites. Which of the following is the most likely cause of this patient's symptoms?", "options": [{"label": "A", "text": "Bacillus cereus", "correct": false}, {"label": "B", "text": "Campylobacter", "correct": true}, {"label": "C", "text": "Giardia Lamblia", "correct": false}, {"label": "D", "text": "Norovirus", "correct": false}], "correct_answer": "B. Campylobacter", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Campylobacter Campylobacter jejuni is a motile, curved, gram-negative rod that is a leading cause of gastroenteritis. The pathogen resides in the gastrointestinal tract of warm-blooded animals and is primarily transmitted to humans due to ingestion of contaminated food, particularly undercooked poultry. However, direct contact with domesticated animals (eg, dogs) is another important source of transmission; puppies from kennels are especially likely to harbor the bacteria. Following ingestion, Campylobacter colonizes the intestinal mucosa , enters enterocytes within endocytic vacuoles, and causes cytotoxic injury due to specific virulence factors (eg, cytolethal distending toxin, lipooligosaccharide}. Patients typically develop fever, crampy abdominal pain, and watery diarrhea that may be bloody. Stool studies will show inflammation (leukocytes, erythrocytes) but no ova or parasites; stool culture is diagnostic (enriched media at 42ᵒ C [107.6 F] and microaerophilic conditions). Manifestations usually resolve spontaneously in 3-5 days. In a minority of cases, the host response to Campylobacter infection generates cross-reacting antibodies to peripheral nerve myelin gangliosides, leading to Guillain-Barre syndrome.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Bacillus cereus and Staphylococcus aureus cause enterotoxin -mediated food-borne illness. Ingestion of the preformed toxin leads to rapid-onset nausea, vomiting, and abdominal pain (diarrhea can occur but is usually mild}. S aureus food-borne illness is often linked to precooked foods, dairy products, custards, and mayonnaise-based salads; B cereus food-borne illness is often associated with starch-based foods, such as reheated rice. Option: C. Giardia lamblia is usually transmitted by drinking contaminated water. Foodborne or person-to-person spread may also occur. Giardia typically causes foul-smelling, watery diarrhea that is noninflammatory; therefore, no fecal blood or leukocytes are typically present. In addition, stool ova and parasite testing often reveal Giardia trophozoites or cysts. Option: D. Norovirus is the most common cause of viral gastroenteritis and is usually transmitted due to food or water contaminated with human feces. Patients typically develop a vomiting-predominant illness with abdominal pain and a moderate amount of watery diarrhea. However, the pathogen is noninflammatory, and therefore no stool blood or leukocytes are seen.</p>\n<p><strong>Extraedge:</strong></p><p>Campylobacteriosis is the disease caused by the infection with Campylobacter: The onset of disease symptoms usually occurs 2 to 5 days after infection with the bacteria, but can range from 1 to 10 days</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Fever, Leukopenia, DIC Disseminated intravascular coagulation, and hypotension caused by members of the Enterobacteriaceae family are most strongly associated with which structure?", "options": [{"label": "A", "text": "H antigens", "correct": false}, {"label": "B", "text": "K antigens", "correct": false}, {"label": "C", "text": "Lipid A", "correct": true}, {"label": "D", "text": "Polysaccharides", "correct": false}], "correct_answer": "C. Lipid A", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lipid A Lipopolysaccharides are integral components of the outer membrane of Gram-negative bacteria and they participate in various membrane functions essential for bacterial growth and survival. For e ndotoxic activities of lipid A the polar substituents of phosphate residues are dispensable. Lipid A is a lipid component of an endotoxin held responsible for the toxicity of gram-negative bacteria. It is the innermost of the three regions of the lipopolysaccharide (LPS), also called endotoxin molecule, and its hydrophobic nature allows it to anchor the LPS to the outer membrane.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. H antigens are located on flagella and are denatured or removed by heat or alcohol. H antigens on the bacterial surface may interfere with agglutination by the anti-O antibody. Option: B. K antigens are external to O antigens on some but not all Enterobacteriaceae . Some are polysaccharides, including the K antigens of E.coli, others are proteins. They may interfere with agglutination by O antisera and they may be associated with virulence.</p>\n<p><strong>Extraedge:</strong></p><p>Escherichia coli is a Gram-negative, facultative anaerobic, rod-shaped, coliform bacterium of the genus Escherichia that is commonly found in the lower intestine of warm-blooded organisms. [3][4] Most E. coli strains are harmless, but some serotypes such as EPEC, and ETEC are pathogenic and can cause serious food poisoning in their hosts, and are occasionally responsible for food contamination incidents that prompt product recalls. [5][6] Most strains are part of the normal microbiota of the gut and are harmless or even beneficial to humans (although these strains tend to be less studied than the pathogenic ones</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All Enterobacteriaceae share all of the following characteristics except:", "options": [{"label": "A", "text": "Ferment glucose", "correct": false}, {"label": "B", "text": "Reduce nitrates to nitrites", "correct": false}, {"label": "C", "text": "Oxidase positive", "correct": true}, {"label": "D", "text": "Gram-negative", "correct": false}], "correct_answer": "C. Oxidase positive", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oxidase positive Enterobacteriaceae are Gram-negative bacteria of a large family that includes Escherichia coli, Klebsiella, Salmonella, Shigella, and Yersinia pestis. Enterobacteriaceae is a family of Gram-negative, facultatively anaerobic, non-spore-forming rods. Characteristics of this family include being motile, catalase positive, and oxidase negative; reduction of nitrate to nitrite; and acid production from glucose fermentation</p>\n<p><strong>Highyeild:</strong></p><p>Characters of Enterobacteriaceae All Enterobacteriaceae - Gram-negative rods - Ferment glucose with acid production - Reduce nitrates into nitrites - Oxidase negative</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. All Enterobacteriaceae do not share these</p>\n<p><strong>Extraedge:</strong></p><p>Facultative anaerobic Motile except Shigella and Klebsiella Non-capsulated except Klebsiella Non-fastidious Grow on bile containing media (MacConkey agar)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about Enterobacteriaceae:", "options": [{"label": "A", "text": "Motile by polar flagella", "correct": false}, {"label": "B", "text": "Glucose is not fermented by all members", "correct": false}, {"label": "C", "text": "All members are oxidase positive", "correct": false}, {"label": "D", "text": "Nitrate reduction positive", "correct": true}], "correct_answer": "D. Nitrate reduction positive", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nitrate reduction positive Family Enterobacteriaceae has the following characteristics- Gram-negative, capsulated or non-capsulated Non-acid fast, non-sporing bacilli, Reduce nitrates to nitrites Aerobes and facultative anaerobes Non-fastidious</p>\n<p><strong>Highyeild:</strong></p><p>Characters of Enterobacteriaceae All Enterobacteriaceae - Gram-negative rods - Ferment glucose with acid production - Reduce nitrates into nitrites - Oxidase negative</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Motile (peritrichous flagella) or non-motile(Klebsiella, Shigella, Y.pestis, S. gallinarum, S. pullorum) Option: C. Oxidase negative, catalase positive (exception S. dysenteriae Type1) Option: B. Ferment glucose with the production of acid/ acid +gas</p>\n<p><strong>Extraedge:</strong></p><p>Facultative anaerobic Motile except Shigella and Klebsiella Non-capsulated except Klebsiella Non-fastidious Grow on bile containing media (MacConkey agar)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Shigella can be differentiated from E. Coli by all of the following features except:", "options": [{"label": "A", "text": "Shigella does not produce gas from glucose", "correct": false}, {"label": "B", "text": "Shigella does not ferment lactose", "correct": false}, {"label": "C", "text": "Shigella does not ferment mannitol", "correct": true}, {"label": "D", "text": "Shigella is nonmotile", "correct": false}], "correct_answer": "C. Shigella does not ferment mannitol", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Shigella does not ferment mannitol All Shigella species ferment mannitol except Shigella dysenteriae. (option C) Others- options A, B, and D are correct. Shigella and Escherichia genera are considered to be unique genomospecies. Unlike E. coli, Shigella strains are nonmotile as a result of a deletion in the fliF operon (flagellar coding region) or an ISI insertion mutation in the flhD operon. (option D) Also, Shigella does not ferment lactose. (option B) All Shigella species ferment mannitol except Shigella dysenteriae.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. These are all common features between Shigella and E.coli hence not commonly help in differentiating between the two</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Escherichia coli can be classified by its characteristic virulence properties and different mechanisms that cause disease. To which group does the verotoxin-producing E. coli 0157:H7 serotype belong? Escherichia coli can be classified by its characteristic virulence properties and different mechanisms that cause disease. To which group does the verotoxin-producing E. coli 0157:H7 serotype belong? Escherichia coli can be classified by its characteristic virulence properties and different mechanisms that cause disease. To which group does the verotoxin-producing E. coli 0157:H7 serotype belong?", "options": [{"label": "A", "text": "Enteroaggregative E. coli (EAEC)", "correct": false}, {"label": "B", "text": "Enterohemorrhagic E. coli (EHEC)", "correct": true}, {"label": "C", "text": "Enterotoxigenic E.Coli (ETEC)", "correct": false}, {"label": "D", "text": "Enteropathogenic E. coli (EPEC)", "correct": false}], "correct_answer": "B. Enterohemorrhagic E. coli (EHEC)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterohemorrhagic E. coli (EHEC) The toxins and the diseases that ETEC causes are not related to E. coli O157:H7. Escherichia coli O157:H7 is a serotype of the bacterial species Escherichia coli and is one of the Shiga-like toxin–producing types of E. coli. It is a cause of disease, typically foodborne illness, through the consumption of contaminated and raw food, including raw milk and undercooked ground beef. E.coli (EHEC) is defined as pathogenic E.coli. Several serotypes in EHEC are frequently associated with human diseases such as O26:H11, O91:H21, O111:H8, O157:NM, and O157:H7. Enterotoxins of E.coli LT and ST of ETEC EAST(enteroaggregative heat-stable enterotoxin) of EAEC VT of EHEC</p>\n<p><strong>Highyeild:</strong></p><p>Escherichia coli Pathogenesis and clinical diseases Enterohemorrhagic E. coli (EHEC) The most common strains producing disease in developed countries. These strains are associated with hemorrhagic colitis and hemolytic uremic syndrome (HUS: acute renal failure, microangiopathic hemolytic anemia and thrombocytopenia; 5-10% infected children). Serotpe O157:H7 is most commonly isolated. Cattle is a reservoir, and hamburger, unpasteurized milk, fruit juices, and uncooked vegetables are common sources of human infection. Induces A/E lesions on enterocytes. Diarrhea and HUS may be associated with the Shiga toxins, which are A-B toxins that bind to 28S rRNA and disrupt protein synthesis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Enteroaggregative E.coli (EAEC) – E.coli O104:H11 Option: C. Serotypes of Enteroinvasive E.coli (EIEC)- O28ac, O29, O112ac, O121, O124 Option: D. Serotypes of Enteropathogenic E.coli (EPEC) – O26, O55, O86, O142, O158</p>\n<p><strong>Extraedge:</strong></p><p>Escherichia coli Pathogenesis and clinical diseases Enterohemorrhagic E. coli (EHEC) The most common strains producing disease in developed countries. These strains are associated with hemorrhagic colitis and hemolytic uremic syndrome (HUS: acute renal failure, microangiopathic hemolytic anemia and thrombocytopenia; 5-10% infected children). Serotpe O157:H7 is most commonly isolated. Cattle is a reservoir, and hamburger, unpasteurized milk, fruit juices, and uncooked vegetables are common sources of human infection. Induces A/E lesions on enterocytes. Diarrhea and HUS may be associated with the Shiga toxins , which are A-B toxins that bind to 28S rRNA and disrupt protein synthesis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Several children are hospitalized with bloody diarrhea and severe hematological abnormalities. A 4-year-old girl dies of kidney failure shortly after admittance. An epidemiological investigation establishes that all of the patients developed symptoms following the consumption of hamburgers from the same fast-food restaurant chain. Which of the following organisms is most likely to be responsible for the outbreak?", "options": [{"label": "A", "text": "Campylobacter jejuni", "correct": false}, {"label": "B", "text": "Non-O1 serogroup of Vibrio cholerae", "correct": false}, {"label": "C", "text": "O157:H7 serotype of E. coli", "correct": true}, {"label": "D", "text": "Shigella dysenteriae", "correct": false}], "correct_answer": "C. O157:H7 serotype of E. coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>O157:H7 serotype of E. coli Enterohemorrhagic E.coli O157:H7 dysentery can lead to complications like hemorrhagic uremic syndrome and hemorrhagic colitis. Serotypes associated with EHEC are O157:H7 and O26:H1. It is a cause of disease, typically foodborne illness, through the consumption of contaminated and raw food, including raw milk and undercooked ground beef. E.coli (EHEC) is defined as pathogenic E.coli. Several serotypes in EHEC are frequently associated with human diseases such as O26:H11, O91:H21, O111:H8, O157:NM, and O157:H7.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. C. jejuni complications are post-diarrheal Guillain-Barre syndrome , reactive arthritis, and reiter’s syndrome. Kidney failure is a rare complication. Option: B. About 50% of infections with classic V cholera are asymptomatic, as are about 75% of infections with the El Tor biotype. The incubation period is 12 hours–3 days for persons who develop symptoms, depending largely on the size of the inoculum ingested. There is a sudden onset of nausea and vomiting and profuse diarrhea with abdominal cramps. Stools, which resemble “rice water,” contain mucus, epithelial cells, and large numbers of vibrios. There is the rapid loss of fluid and electrolytes, which leads to profound dehydration, circulatory collapse, and anuria. The mortality rate without treatment is between 25% and 50%. Option: D. Shigella infection causes sudden onset of abdominal pain, fever, and watery diarrhea (not bloody diarrhea)</p>\n<p><strong>Extraedge:</strong></p><p>E.Coli O157:H7 coli enterohemorrhagic strain of the bacterium Escherichia coli Gram negative, rod shaped bacterium The \"O\" in the name refers to the cell wall (somatic) antigen number, whereas the \"H\" refers to the flagella antigen</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "On culture Escherichia coli produced pink colored colony in:", "options": [{"label": "A", "text": "MacConkey's medium", "correct": true}, {"label": "B", "text": "Wilson Blair Media", "correct": false}, {"label": "C", "text": "Deoxycholate citrate agar", "correct": false}, {"label": "D", "text": "Selenite F broth", "correct": false}], "correct_answer": "A. MacConkey's medium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>MacConkey's medium MacConkey agar: It differentiates organisms into LF or lactose fermenters (produce pink colonies, e.g. E. coli and Klebsiella) and NLF (produce colorless colonies, e.g. Shigella and Salmonella). E.coli was made based on its characteristic morphology colony on the selective medium MacConkey agar. Rapid lactose fermenting colonies of E. coli appear dry, donut-shaped, and dark pink and are surrounded by a dark pink area of precipitated bile salts. V</p>\n<p><strong>Highyeild:</strong></p><p>Uninoculated plate Colorless colonies Pink colonies Lactose non feremters Lactose feremters Salmonella, Shigella, E. coli, Citrobacter Proteus Klebsiella, Enterobacter</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Wilson Blair Media-Selective media for Salmonella. Option: C. Deoxycholate citrate agar- Selective media for Salmonella and Shigella. Option: D. Selenite F broth- Enrichment media for Salmonella and Shigella.</p>\n<p><strong>Extraedge:</strong></p><p>Mnemonic to remember MacConkey Agar Constituents \"PLANT\" P: Peptone L: Lactose A: Agar N: Neutral red (Indicator) T: Taurocholate (Bile Salts)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A microbiologist wants to develop a vaccine for the prevention of attachment of diarrheagenic E. coli to the specific receptors in the GIT. All of the following fimbrial adhesion molecules would be appropriate vaccine candidates except:", "options": [{"label": "A", "text": "CFA-1", "correct": false}, {"label": "B", "text": "CS-2", "correct": false}, {"label": "C", "text": "P pili", "correct": true}, {"label": "D", "text": "K-88", "correct": false}], "correct_answer": "C. P pili", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>P pili P fimbriae or P pili or Pap are chaperon-usher type fimbrial appendages found on the surface of many Escherichia coli bacteria. P pili mediate the binding of uropathogenic E. coli to a digalactoside receptor determinant present in the urinary tract epithelium. The adhesins are located at the distal ends of the pili, connected to the rigid, helical pilus rod via a linear tip structure. P pili mediate the binding of uropathogenic E. coli to a digalactoside receptor determinant and are surrounded with a dark pink area of precipitated bile salts.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. They will aid in the prevention of attachment of diarrheagenic E.coli to the specific receptors in the GIT</p>\n<p><strong>Extraedge:</strong></p><p>In the bladder, type 1 pili are required for binding and invasion of UPEC into superficial facet cells that line the bladder lumen and for the formation of intracellular bacterial communities (IBCs) during the first 6–18 hr of acute infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "E. coli gets attached to the surface of intestinal epithelial cells with the help of", "options": [{"label": "A", "text": "Fucose", "correct": false}, {"label": "B", "text": "Concanavalin", "correct": false}, {"label": "C", "text": "Lectin", "correct": true}, {"label": "D", "text": "Phytohemagglutinin", "correct": false}], "correct_answer": "C. Lectin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lectin coli bacteria bind to intestinal cells. Although most Escherichia coli. coli bacterium uses a series of proteins to attach itself to a human intestinal epithelial cell. E. coli is commonly used to produce non-glycosylated lectins.</p>\n<p><strong>Highyeild:</strong></p><p>The chief function of lectins in animals is to facilitate cell-cell contact. A lectin usually contains two or more binding sites for carbohydrate units; some lectins form oligomeric structures with multiple binding sites. Lectins are a type of protein that can bind to cell membranes. They are sugar-binding and become the “glyco” portion of glycoconjugates on the membranes. Lectins offer a way for molecules to stick together without getting the immune system involved, which can influence cell-cell interaction, and are surrounded with dark pink areas of precipitated bile salts.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. These do not help E.coli in the attachment. CFA is a fimbrial antigen expressed in enterotoxigenic E.coli, is the organ of adhesion, and helps in attachment and colonization.</p>\n<p><strong>Extraedge:</strong></p><p>Certain strains of E. coli, such as O157:H7, O104:H4, O121, O26, O103, O111, O145, and O104:H21, produce potentially lethal toxins. Food poisoning caused by E. coli can result from eating unwashed vegetables or poorly butchered and undercooked meat.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements regarding Enterotoxigenic E. coli are CORRECT?", "options": [{"label": "A", "text": "They are important causes of traveler's diarrhea.", "correct": false}, {"label": "B", "text": "Transmission occurs from the ingestion of contaminated food and water.", "correct": false}, {"label": "C", "text": "Disease is caused by the production of one or both of two types of enterotoxins", "correct": false}, {"label": "D", "text": "All of the above are correct.", "correct": true}], "correct_answer": "D. All of the above are correct.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above are correct. E.coli (ETEC) has been reported to be the most important pathogen responsible for TD (Traveller’s Diarrhoea ) since the 1970s. (option A) ETEC produces plasmid-encoded secretory toxins, including cholera-like, heat-labile (LT), and small molecular weight, heat-stable toxins. The other E. coli strain that is important in TD (travelers' diarrhea) is enteroaggregative E. Traveller'sdiarrhea is a digestive tract disorder that commonly causes loose stools and abdominal cramps. It's caused by eating contaminated food or drinking contaminated water. (option B) ETEC causes watery diarrhea through the actions of 2 toxins, the heat-stable toxin (ST), and the heat-labile toxin (LT)</p>\n<p><strong>Highyeild:</strong></p><p>Enterotoxigenic E. coli (ETEC) Adhere to intestinal mucosa by fimbriae Produce enterotoxins Plasmids contain genes for enterotoxins Cause leakage of intestinal epithelial cells Loss electrolytes and water Cause diarrhea in children & adults ✔ Traveler's diarrhea ✔ Weanling diarrhea</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Not required. Self-explanatory.</p>\n<p><strong>Extraedge:</strong></p><p>Persons from developed countries visiting endemic areas often suffer from ETEC diarrhea - TRAVELER'S DIARRHEA. Endemic in developing countries in tropics, all age groups. Mild watery diarrhea to fatal disease indistinguishable from cholera.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old has fever and diarrhea and Rose spots. Blood culture grows a gram-negative rod. This is most likely to be which of the following?", "options": [{"label": "A", "text": "Group B Streptococcus", "correct": false}, {"label": "B", "text": "Listeria species", "correct": false}, {"label": "C", "text": "Salmonella", "correct": true}, {"label": "D", "text": "Meningococci", "correct": false}], "correct_answer": "C. Salmonella", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Salmonella Diagnosis- Typhoid Fever Salmonella enterica serotype typhi is a gram-negative bacterium that is responsible for typhoid fever. Salmonella bacteria typically live in animal and human intestines and are shed through feces. Humans become infected most frequently through contaminated water or food. Typically, people with salmonella infection have no symptoms. Others develop diarrhea, fever, and abdominal cramps within eight to 72 hours Rose spots are also seen in Typhoid.. Salmonella is a genus of rod-shaped (bacillus) Gram-negative bacteria of the family Enterobacteriaceae. Salmonella species are non-spore-forming, predominantly motile enterobacteria with cell diameters between about 0.7 and 1.5 μm, lengths from 2 to 5 μm, and peritrichous flagella (all around the cell body.</p>\n<p><strong>Highyeild:</strong></p><p>Salmonellosis Salmonella species Salmonella species live in animal GI tracts (animal feces in food/water) Typhoid Fever (Caused by Salmonella typhi)- o Ingestion of contaminated food/drink, bacteria crosses through epithelium Infects lymphatic system and can seed multiple organ systems Symptoms include headache, fever, abd pain, constipation, rose spots May cause splenomegaly Fever increases in stepwise fashion over days and then decreases Diagnosed with blood culture. Complication of intestinal hemorrhage causes death Responds to Ciprofloxacin or Ceftriaxone</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. S. agalactiae is a gram-positive coccus . Option: B. Listeria species is gram-positive, rod-shaped, and facultatively anaerobic and do not produce endospores. Option: D. Shigella is a gram-negative rod that manifests as sudden onset of abdominal pain, fever, and watery diarrhea</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the organism which shows effacement and attachment of intestinal cells as shown below", "options": [{"label": "A", "text": "EPEC", "correct": true}, {"label": "B", "text": "ETEC", "correct": false}, {"label": "C", "text": "Entero hemorrhagic E. coli", "correct": false}, {"label": "D", "text": "EIEC", "correct": false}], "correct_answer": "A. EPEC", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506399094-QTDV018015IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>EPEC Escherichia coli is a gram-negative, rod-shaped bacterium that is commonly found in the lower intestine of warm-blooded organisms. Most E. coli strains are harmless, but pathogenic varieties cause serious food poisoning, septic shock, meningitis, or urinary tract infections in humans.</p>\n<p><strong>Highyeild:</strong></p><p>Enteropathogenic Escherichia coli (EPEC) is a non-Shiga toxin-producing strain of E. coli that causes diarrhea via an \"attaching and effacing\" mechanism on the surface of enterocytes (Option A). Infection occurs when, following ingestion by the host, EPEC adheres to intestinal epithelial cells and forms attaching and effacing (A/E) lesions. The formation of A/E lesions requires the locus of enterocyte effacement (LEE), which encodes a type three-secretion system (TTSS) and multiple effector molecules (3)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. In ETEC infections, the ETEC colonization factors (pili known as colonization factor antigens or CFAs) specific for humans promote adherence of ETEC to epithelial cells of the small bowel. Options: C and D. They do not show the effacement and attachment of intestinal cells.</p>\n<p><strong>Extraedge:</strong></p><p>ENTEROPATHOGENIC E-COLI (EPEC) They cause infantile diarrhoea usually occuring as institutional outbreaks. They can also cause sporadic diarrhoea in children and very rarely in adults. Spread is through oral contamination. In infantile enteritis there is colonisation of upper part of small intestine. In areas of EPEC attachment brush border microvilli are lost.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Each of the following agents is a recognized cause of diarrhea except:", "options": [{"label": "A", "text": "Clostridium perfringens", "correct": false}, {"label": "B", "text": "Vibrio cholera", "correct": false}, {"label": "C", "text": "Enterococcus faecalis", "correct": true}, {"label": "D", "text": "Escherichia coli", "correct": false}], "correct_answer": "C. Enterococcus faecalis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterococcus faecalis Enterococcus faecalis and E. faecium cause a variety of infections, including endocarditis, urinary tract infections, prostatitis, intra-abdominal infection, cellulitis, and wound infection as well as concurrent bacteremia. Enterococcus faecalis - formerly classified as part of the group D Streptococcus system - is a Gram-positive, commensal bacterium inhabiting the gastrointestinal tracts of humans and other mammals.</p>\n<p><strong>Highyeild:</strong></p><p>Faecalis infections spread from person to person through poor hygiene . Because these bacteria are found in feces, people can transmit the infection if they don't wash their hands after using the bathroom. The bacteria can get into food or onto surfaces such as doorknobs, telephones, and computer keyboards. Enterococci are gram-positive, facultative anaerobic organisms. Enterococcus faecalis and E. faecium cause a variety of infections, including endocarditis, urinary tract infections, prostatitis, intra-abdominal infection, cellulitis, and wound infection as well as concurrent bacteremia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Clostridium perfringens causes invasive infections, spores reach tissue either by contamination of traumatized areas (soil, feces) or from the intestinal tract. Option: B. Vibrio cholera is pathogenic only for humans. It is an invasive infection. The organisms do not reach the bloodstream but remain within the intestinal tract Option: D. E.coli that cause diarrhea is extremely common worldwide</p>\n<p><strong>Extraedge:</strong></p><p>Enterococcus faecalis Enterococcus faecalis is gram-negative bacteria which is the cause of nosocomial infections. It also causes infection of GI track and also the cause of RCT infection in dental practices. A slide showing it is gram negative It can ferment glucose and is negative to catalase reaction which is done to check H₂O, hydrolysis by a bacterium using the enzyme catalase. If bacteria have catalase enzyme, they show this reaction which indicate they are catalase positive</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not true about members of the family Enterobacteriaceae?", "options": [{"label": "A", "text": "They are all catalase-positive", "correct": false}, {"label": "B", "text": "They are all oxidase-negative", "correct": false}, {"label": "C", "text": "They all ferment glucose", "correct": false}, {"label": "D", "text": "They all ferment lactose", "correct": true}], "correct_answer": "D. They all ferment lactose", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>They all ferment lactose Some members of the family Enterobacteriaceae like Salmonella, Shigella, and Proteus are Non-lactose fermenters. Enterobacteriaceae are Gram-negative bacteria of a large family that includes Escherichia coli, Klebsiella, Salmonella, Shigella, and Yersinia pestis. From Saliva Protection and Transmissible Diseases. Many different types of Enterobacteriaceae can develop resistance, including Klebsiella pneumoniae and Escherichia coli (E. coli). These bacteria can cause infections including pneumonia, bloodstream infections, urinary tract infections, wound infections, and meningitis. Lactose usually is fermented rapidly by Escherichia, Klebsiella, and some Enterobacter species and more slowly by Citrobacter and some Serratia species. Proteus, unlike the coliforms, deaminates phenylalanine to phenyl pyruvic acid, and it does not ferment lactose. Typically, Proteus is rapidly urease positive.</p>\n<p><strong>Highyeild:</strong></p><p>Characters of Enterobacteriaceae All Enterobacteriaceae Gram-negative rods - Ferment glucose with acid production Reduce nitrates into nitrites - Oxidase negative Facultative anaerobic Motile except Shigella and Klebsiella Non-capsulated except Klebsiella Non-fastidious • Grow on bile containing media (MacConkey agar)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Enterobacteriaceae are the most common group of gram-negative rods cultured in clinical laboratories and along with staphylococci and streptococci are among the most common bacteria that cause disease. They are catalase positive. Option: B. They are al oxidase negative (except for plesimonas) Option: C. They are facultative anaerobes, they ferment rather than oxidize glucose.</p>\n<p><strong>Extraedge:</strong></p><p>THE ENTEROBACTERIACEAE GENERAL CHARACTERISTICS Non-sporulating, facultative anaerobic gram (-), short rods Have simple nutritional requirements MacConkey agar - isolate and differentiate Lactose fermenters: (CEEK) Citrobacter Enterobacter Escherichia Klebsiella Non-lactose fermenters: (ShYPS) Shigella Yersinia Proteus Salmonella Motile by peritrichous (lateral) flagella EXCEPT Shigella and Klebsiella - non-motile (+) Catalase positive (-) Cytochrome c oxidase separates enterics from oxidase (+): Pseudomonas, Aeromonas, Vibrio, Alcaligenes, Achromobacter, Flavibacterium, Cardiobacterium Usually reduces Nitrate to Nitrite Contain enterobacterial common antigen. O: Outer membrane H: Flagella K: Capsule Vi: Capsule of Salmonella Produces acid from glucose; ability to ferment lactose-distinguishes enteric from obligately aerobic bacteria. Sodium is neither required nor stimulatory for growth</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient come to OPD with a complain of bloody diarrhea and abdominal pain. On examination Patient was afebrile. His stool sample was sent for examination. The doctor confirmed it to be an infection by enterohemorrhagic E.coli. which of the following is not a true statement about its laboratory investigation:", "options": [{"label": "A", "text": "Faecal leukocytosis", "correct": false}, {"label": "B", "text": "Pink colonies on Sorbitol MacConkey agar.", "correct": true}, {"label": "C", "text": "Black colonies on Rainbow agar.", "correct": false}, {"label": "D", "text": "Shigella like toxin in Vero cell lines.", "correct": false}], "correct_answer": "B. Pink colonies on Sorbitol MacConkey agar.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pink colonies on Sorbitol MacConkey agar. EHEC in contrast to other E.coli does not ferment sorbitol and hence produces pale colonies. O157 strains appear black on Rainbow agar as they are negative for beta- glucuronidase. Shiga like toxin is responsible for EHEC pathogenesis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, C, and D. These are not relevant laboratory investigations for Enteroheaemorrhagic E.coli or EHEC</p>\n<p><strong>Extraedge:</strong></p><p>E.coli serotype differentiation immunologic assay growth on MacConkey agar with sorbitol (S- Mac) most E. coli can ferment sorbitol (form pink colonies) E. coli O157:H7 does not ferment sorbitol (colonies are clear/colorless)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the oldest method of classification of the family Enterobacteriaceae:", "options": [{"label": "A", "text": "Bergey's manual.", "correct": false}, {"label": "B", "text": "Based on lactose fermentation.", "correct": true}, {"label": "C", "text": "Edwards Ewing classification.", "correct": false}, {"label": "D", "text": "Farmer and Kelley classification.", "correct": false}], "correct_answer": "B. Based on lactose fermentation.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Based on lactose fermentation. The oldest method of classification is based on lactose fermentation on MacConkey agar into three groups- Lactose fermenters(LF). Non lactose fermenters (NLF) Late lactose fermenters (LLF) . Option: A, C, and D are all newer methods.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Bergey’s Manual first published in 1923 by David Hendricks Bergey, it is used to classify bacteria based on their structural and functional attributes by arranging them into specific familial orders. Option C. Edward Ewing’s classification classifies the Enterobacteriaceae family into 8 tribes. Ewing's classification of the family Enterobacteriaceae Tribe Genus/Genera Tribe I Escherichieae Escherichia Shigella Tribe II Edwardsielleae Edwardsiella Tribe III Salmonelleae Salmonella Tribe IV Citrobactereae Citrobacter Tribe V Klebsielleae Klebsiella Enterobacter Serratia Hafnia Tribe VI Proteeae Proteus Morganella Providencia Tribe VII Yersinieae Yersinia Tribe VIII Erwinieae Erwinia</p>\n<p><strong>Extraedge:</strong></p><p>Adhesins, which appear as hair-like fibers called fimbriae (or pili), facilitate the colonization with E. coli in the urinary tract by attaching to host epithelial cells. This attachment promotes the persistence of the organism in the bladder, and serves as a reservoir for ascending infection in the urinary tract</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Select the correct statement about the somatic or O antigen of Escherichia coli:", "options": [{"label": "A", "text": "It is the lipopolysaccharide antigen.", "correct": true}, {"label": "B", "text": "It is heat labile.", "correct": false}, {"label": "C", "text": "Early O serotypes are diarrhea-producing strains.", "correct": false}, {"label": "D", "text": "Serotyping is done by latex agglutination with specific O antisera.", "correct": false}], "correct_answer": "A. It is the lipopolysaccharide antigen.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It is the lipopolysaccharide antigen. O antigen is made up of lipopolysaccharide.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenic E. coli strains can be categorized based on elements that can elicit an immune response in animals, namely: O antigen: part of lipopolysaccharide layer K antigen: capsule H antigen: flagellin For example, E. coli strain EDL933 is of the O157:H7 group.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. O antigen is heat-stable and not heat labile Option: C. Early O serotypes are usually commensals of the intestine while late O serotypes types produce diarrhea. Option: D. Serotyping is done by slide agglutination.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following antigen contribute to virulence by inhibiting phagocytosis:", "options": [{"label": "A", "text": "Somatic or O antigen.", "correct": false}, {"label": "B", "text": "Flagellar or H antigen", "correct": false}, {"label": "C", "text": "Capsular or K antigen", "correct": true}, {"label": "D", "text": "Fimbrial antigen.", "correct": false}], "correct_answer": "C. Capsular or K antigen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Capsular or K antigen Capsules protect the bacilli from phagocytosis by inhibiting opsonization.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenesis is the process by which an infection leads to disease. Pathogenic mechanisms of viral disease include (1) implantation of virus at the portal of entry, (2) local replication, (3) spread to target organs (disease sites), and (4) spread to sites of shedding of virus into the environment.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. O antigen is responsible for the endotoxic activity. Option: B. H antigen makes the bacteria motile, hence increasing Option: D. Fimbrial antigen helps in attachment and colonization.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Select the option containing all Nonlactose fermenters:", "options": [{"label": "A", "text": "Klebsiella, Salmonella and Proteus.", "correct": false}, {"label": "B", "text": "Klebsiella , Salmonella and Yersinia.", "correct": false}, {"label": "C", "text": "Proteus , Salmonella and Yersinia.", "correct": true}, {"label": "D", "text": "Escherichia, Salmonella and Yersinia.", "correct": false}], "correct_answer": "C. Proteus , Salmonella and Yersinia.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Proteus , Salmonella and Yersinia.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenic E. coli strains can be categorized based on elements that can elicit an immune response in animals, namely: O antigen: part of lipopolysaccharide layer K antigen: capsule H antigen: flagellin For example, E. coli strain EDL933 is of the O157:H7 group.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and D. Lactose fermenters - Escherichia and Klebsiella. Non Lactose fermenters- Salmonella , Shigella , Proteus , Morganella , Providencia and Yersinia.</p>\n<p><strong>Extraedge:</strong></p><p>Lab identification of the enterics MacConkey Agar Selective Bile salts/crystal violet inhibit gram positives and most others besides Enterobacteriaceae and Pseudomonas Indicator Neutral red Ferment lactose (acid=pink) No fermentation - colorless</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following enterotoxin of E.coli works by increasing intracellular accumulation of cAMP:", "options": [{"label": "A", "text": "Heat labile toxin (LT).", "correct": true}, {"label": "B", "text": "Heat stable toxin (ST)", "correct": false}, {"label": "C", "text": "Verocytotoxin", "correct": false}, {"label": "D", "text": "Shiga-like toxin.", "correct": false}], "correct_answer": "A. Heat labile toxin (LT).", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Heat labile toxin (LT). Fragment A1 of LT causes ADP ribosylation of G protein which upregulates the activity of adenylyl cyclase leading to increased intracellular accumulation of cAMP.</p>\n<p><strong>Highyeild:</strong></p><p>Heat-labile enterotoxin (LT) and heat-stable enterotoxin (ST) - mechanism of action Enterotoxigenic Escherichia coli (ETEC) becomes anchored to enterocytes of the small intestine through colonization factors (CFs) and an adhesin that is found at the tip of the flagella (EtpA). Tighter adherence is mediated through Tia and TibA. Two toxins, heat-labile enterotoxin (LT) and heat-stable enterotoxin (ST), are secreted and cause diarrhoea through cyclic AMP (CAMP)- and cyclic GMP (cGMP)-mediated activation of cystic fibrosis transmembrane conductance regulator (CFTR).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. ST1 acts by increasing cGMP. However, the MOA of ST2 is not known yet. Option: C and D. Verocytotoxin or Shiga-like toxin act by inhibiting protein synthesis by inhibiting the 28S subunit of the 60S subunit ribosome.</p>\n<p><strong>Extraedge:</strong></p><p>Escherichia coli commonly abbreviated E. coli ) is a gram-negative, rod-shaped bacterium that is commonly found in the lower intestine of warm-blooded organisms (endotherms). Most E. coli strains are harmless, but pathogenic varieties cause serious food poisoning, septic shock, meningitis, or urinary tract infections in humans. Unlike normal flora E. coli , the pathogenic varieties produce toxins and other virulence factors that enable them to reside in parts of the body normally not inhabited by E. coli , and to damage host cells. [3] These pathogenic traits are encoded by virulence genes carried only by the pathogens</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Plasmid coded enterotoxin of E.coli is:", "options": [{"label": "A", "text": "Heat labile toxin (LT)", "correct": false}, {"label": "B", "text": "Heat stable toxin (ST)", "correct": false}, {"label": "C", "text": "Verocytotoxin or shiga like toxin.", "correct": false}, {"label": "D", "text": "Both A and B.", "correct": true}], "correct_answer": "D. Both A and B.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both A and B. Both LT and ST are plasmids coded</p>\n<p><strong>Highyeild:</strong></p><p>Heat-labile enterotoxin (LT) and heat-stable enterotoxin (ST) - mechanism of action Enterotoxigenic Escherichia coli (ETEC) becomes anchored to enterocytes of the small intestine through colonization factors (CFs) and an adhesin that is found at the tip of the flagella (EtpA). Tighter adherence is mediated through Tia and TibA. Two toxins, heat-labile enterotoxin (LT) and heat-stable enterotoxin (ST), are secreted and cause diarrhoea through cyclic AMP (CAMP)- and cyclic GMP (cGMP)-mediated activation of cystic fibrosis transmembrane conductance regulator (CFTR).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: C. Verocytotoxin or shiga-like toxin is bacteriophage coded</p>\n<p><strong>Extraedge:</strong></p><p>Enterotoxigenic Escherichia coli (ETEC) is a major cause of diarrhea in children and travelers in developing countries. ETEC is characterized by the ability to produce major virulence factors including colonization factors (CFs) and enterotoxins, that bind to specific receptors on epithelial cells and induce diarrhea</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are diarrheagenic E.coli except:", "options": [{"label": "A", "text": "Enterohemorrhagic E.coli", "correct": false}, {"label": "B", "text": "Enteroinvasive E. Coli", "correct": false}, {"label": "C", "text": "Uropathogenic E.coli", "correct": true}, {"label": "D", "text": "EAEC", "correct": false}], "correct_answer": "C. Uropathogenic E.coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Uropathogenic E.coli Uropathogenic E. Coli is responsible for Urinary Tract infection. coli cause urinary tract infections and accounts for approximately 90% of first urinary tract infections in young women. The symptoms and signs are urinary frequency, dysuria, hematuria, and pyuria Most of the UTI infections that involve the bladder or kidney in an otherwise healthy host are caused by a small number of O antigen types.</p>\n<p><strong>Highyeild:</strong></p><p>Commensal strains \"Harmless\" commensal E. coli Intestinal pathogenic strains (IPEC) EPEC — enteropathogenic E. coli EHEC — enterohemorrhagic E. coli EIEC — enteroinvasive E. coli ETEC — enterotoxogenic E. coli Causing diarrhea Extraintestinal pathogenic strains (ExPEC) NMEC - meningitis E. coli, causing newborn meningitis (NBM) UPEC — uropathogenic E. coli, causing UTI and pyelonephritis SEPEC - sepsis associated E. coli</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and D. All others causes diarrhea. Diarrheagenic E.coli: EPEC frequently causes infantile diarrhea ETEC is the most common cause of traveler’s diarrhea EIEC: Causes ulceration of the bowel, dysentery</p>\n<p><strong>Extraedge:</strong></p><p>Examples of organisms secreting enterotoxins are: Escherichia coli O157:H7, Clostridium perfringens, Vibrio cholerae, Staphylococcus aureus, Rotavirus and Yersinia enterocolitica. These toxins have A and B subunits. The A subunit is responsible for the loss of permeability of the intestinal endothelial cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about traveler's diarrhea except:", "options": [{"label": "A", "text": "Most commonly caused by enterotoxigenic E.coli (ETEC).", "correct": false}, {"label": "B", "text": "Causes acute watery diarrhea in infants and stool.", "correct": false}, {"label": "C", "text": "Mediated by verocytotoxin", "correct": true}, {"label": "D", "text": "Toxin detection is the mainstay of diagnosis.", "correct": false}], "correct_answer": "C. Mediated by verocytotoxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mediated by verocytotoxin Verocytotoxin does not mediate traveler’s diarrhea It is caused by EHEC</p>\n<p><strong>Highyeild:</strong></p><p>Enterotoxigenic E. coli (ETEC) Pathogenesis of ETEC involves two steps: Intestinal colonization: fimbrial (K88, K99) or colonization factor antigens (CFA I, II, III, IV, etc)- non invasive Diarrheagenic enterotoxin(s) - LT and/or ST toxin Produce LT or ST or both. Cause diarrhea in infants and travelers. Both traits are plasmid-encoded Fimbriae: K88 (F4): Pigs K99 (F5): Calves and lambs 987P (F6): F41: Calves</p>\n<p><strong>Random:</strong></p><p>Explanation for other options: - Pathogenicity of ETEC is by heat labile and heat stable toxin. Heat labile acts by increasing cAMP while heat stable acts by increasing cGMP. EPEC frequently causes infantile diarrhea(option A) ETEC is the most common cause of traveler’s diarrhea EIEC: Causes ulceration of the bowel, and dysentery. ETEC causes acute watery diarrhea and Toxin detection is the mainstay of diagnosis. (option C and D)</p>\n<p><strong>Extraedge:</strong></p><p>coli strains, STEC produces a toxin called “Shiga toxin.” This toxin is responsible for the bloody diarrhea, HUS, and other symptoms that occur with this infection. Spread of the bacteria occurs in many ways and includes: Drinking water contaminated with human or animal feces containing the bacterium.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient with a complaint of diarrhea with blood and mucus. CT scan examination reveals ulcerations of the bowel. The most common cause of such a condition is:", "options": [{"label": "A", "text": "ETEC", "correct": false}, {"label": "B", "text": "EIEC", "correct": true}, {"label": "C", "text": "UPEC", "correct": false}, {"label": "D", "text": "EPEC", "correct": false}], "correct_answer": "B. EIEC", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>EIEC This is a case of dysentery caused by Entero invasive E.coli. EIEC is biochemically, genetically, and pathogenically closely related to Shigella.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenesis of Diarrhea: Enteroinvasive E. coli (EIEC ): ➤ EIEC cause disease dysentery-like syndrome. ➤Virulence factors are nearly identical to Shigella species; that allow the invasion of mucosal epithelial cells of the large intestine and intracellular spread Tissue destruction diarrhea, blood, mucous, and painful abdominal cramps</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. ETEC causes traveler's diarrhea. Option: C. UPEC causes urinary tract infection. Option: D. EPEC causes infantile diarrhea.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Mechanism of diarrhea in Enteropathogenic E. Coli infection is:", "options": [{"label": "A", "text": "Mediated by bundle forming pili.", "correct": true}, {"label": "B", "text": "Mediated by heat-labile enterotoxin.", "correct": false}, {"label": "C", "text": "Mediated by Colonization factor antigen.", "correct": false}, {"label": "D", "text": "Mediated by verocytotoxin.", "correct": false}], "correct_answer": "A. Mediated by bundle forming pili.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mediated by bundle forming pili. Enteropathogenic E. coli (EPEC) EPEC frequently causes infantile diarrhea ( outbreaks) and rarely sporadic diarrhea in adults. It is nontoxigenic non-invasive Mechanism of diarrhea: Adhesion to the intestinal mucosa, mediated by plasmid-coded bundle-forming pili A/E lesions (attaching and effacing lesions) on the intestinal epithelium.</p>\n<p><strong>Highyeild:</strong></p><p>Entero pathogenic E. coli (EPEC) Important cause of diarrhoea in infants of developing countries. Adhere to mucosal cells in small bowel, lead to loss of microvilli, result in watery diarrhoea. Normally do not produce toxins, NON INVASIVE</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B and C. Is the mechanism of traveler’s diarrhea by ETEC. Option D. Verocytotoxin mediates diarrhea caused by EHEC.</p>\n<p><strong>Extraedge:</strong></p><p>Heat-stable enterotoxins produced by ETEC are secreted peptides that can be divided in two types, STa and STb. While the latter is more virulent in animals and particularly in post-weaning pigs, the STa enterotoxin is more relevant in diarrhea induction in humans, newborn piglets and calves</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Hemorrhagic colitis and Hemorrhagic Uremic syndrome (HUS) are manifestations of which diarrheagenic strain of E.coli.", "options": [{"label": "A", "text": "Enteropathogenic E.coli", "correct": false}, {"label": "B", "text": "Enteroinvasive E.coli", "correct": false}, {"label": "C", "text": "Diffusely adherent E.coli.", "correct": false}, {"label": "D", "text": "None of the above.", "correct": true}], "correct_answer": "D. None of the above.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>None of the above.</p>\n<p><strong>Highyeild:</strong></p><p>Enterohemorrhagic E. coli (EHEC) Severe gastrointestinal distress Hemorrhagic colitis Crampy abdominal pain Watery diarrhea Bloody diarrhea Little or no fever New serotype O157:H7 in 1983 - Undercooked hamburgers 157th somatic O antigen/7th flagellar H antigen Hemorrhagic colitis : Abdominal cramps, blood stools, with minor or no fever Post diarrheal hemolytic ureamic syndrome Acute renal injury Thrombocytopenia : An abnormal decrease in the number of platelets in circulatory blood. Microangiopathic hemolytic anemia: The fragmentation of red blood cells because of narrowing or obstruction of small blood vessels. Enterohemorrhagic E. coli (EHEC): Among the most dangerous enteric pathogens</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Hemorrhagic colitis and hemorrhagic uremic syndrome are caused by Enterohemorrhagic E.coli. (EHEC 0157/H7) Option A. EPEC causes infantile diarrhea. Option B. EIEC causes dysentery with ulceration of the bowel. Option C. DAEC causes diarrhea primarily in children aged 2-6 years of age.</p>\n<p><strong>Extraedge:</strong></p><p>Enterohemorrhagic E. coli (EHEC) Severe gastrointestinal distress Hemorrhagic colitis Crampy abdominal pain Watery diarrhea Bloody diarrhea Little or no fever New serotype O157:H7 in 1983 - Undercooked hamburgers 157th somatic O antigen/7th flagellar H antigen Hemorrhagic colitis : Abdominal cramps, blood stools, with minor or no fever Post diarrheal hemolytic ureamic syndrome Acute renal injury Thrombocytopenia : An abnormal decrease in the number of platelets in circulatory blood. Microangiopathic hemolytic anemia: The fragmentation of red blood cells because of narrowing or obstruction of small blood vessels. Enterohemorrhagic E. coli (EHEC): Among the most dangerous enteric pathogens</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Select the correct statement about biochemical identification of E.coli.", "options": [{"label": "A", "text": "Indole (+), Citrate (-), Urease (-) and TSI: A/A, gas(+) H2 S (-).", "correct": true}, {"label": "B", "text": "Indole (+) , Citrate (-) , Urease (+) and TSI : A/A, gas(+) H2 S (-).", "correct": false}, {"label": "C", "text": "Indole (+) , Citrate (+) , Urease (-) and TSI : A/A, gas(+) H2 S (-).", "correct": false}, {"label": "D", "text": "Indole (-) , Citrate (-) , Urease (-) and TSI : A/A, gas(+) H2 S (-).", "correct": false}], "correct_answer": "A. Indole (+), Citrate (-), Urease (-) and TSI: A/A, gas(+) H2 S (-).", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Indole (+), Citrate (-), Urease (-) and TSI: A/A, gas(+) H2 S (-). E. coli produces the enzyme tryptophanase and gives an indole test positive with a cherry red colored ring. E. coli do not utilize citrate and does not hydrolyze urea. On TSI it produces acidic slant/acidic but with the production of gas by sugar fermentation but do not produce hydrogen sulfide.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C, and D. All these options are not biochemical identification of E.coli. Explained above.</p>\n<p><strong>Extraedge:</strong></p><p>Citrate utilization test This test detects the ability of an organism to utilize citrate as the sole source of carbon and energy. Bacteria are inoculated on a medium containing sodium citrate and a pH indicator bromothymol blue.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The laboratory diagnosis of a particular gram-negative bacteria is as follows. Flat and pink colonies on MacConkey agar. Uniform turbidity in peptone water broth. Hanging drop reveals motile bacilli. Select the most probable bacilli-", "options": [{"label": "A", "text": "Klebsiella pneumonia", "correct": false}, {"label": "B", "text": "Yersinia pestis", "correct": false}, {"label": "C", "text": "Escherichia coli", "correct": true}, {"label": "D", "text": "Shigella dysentery.", "correct": false}], "correct_answer": "C. Escherichia coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Escherichia coli E. coli ferments lactose so produce pink colonies on MacConkey agar. E.coli is motile due to peritrichate flagella. Klebsiella and Shigella are nonmotile Yersinia is a non-lactose fermenter and produces pale colonies.</p>\n<p><strong>Highyeild:</strong></p><p>General Characteristics of E. coli Morphology: Gram negative, rods, appear in singles or in pairs. Culture: ✓ facultative anaerobe, grow between 10-40 °C (optimal at 37 °C). ✓ On MacConkey medium produce bright pink colonies (Lactose fermenters). ✓ Give a metallic green sheen colonies on EMB. Biochemical Reactions : Oxidase- Negative, Indole test-Positive. Motile by flagella- (Very few strains non motile)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Klebsiella pneumonia exhibits mucoid growth, large polysaccharide cap- sules, and lack of motility, and they usually give positive test results for lysine decarboxylase and citrate. It produces urinary tract infections and bacteremia with focal lesions in debilitated patients. Other enterics also may produce pneumonia. Recently a particular clone of K pneumonia has emerged as a cause of community-acquired pyogenic liver abscess that is seen mostly among Asian males worldwide. Option: B. Yersinia pestis causes Plague an infection of wild rodents transmitted from one rodent to another and occasionally from rodents to humans by the bites of fleas. Y pestis is a Gram-negative rod that exhibits striking bipolar staining with special stains such as Wright, Giemsa, Wayson, or methylene blue. It is non-motile. It grows as a facultative anaerobe on many bacteriologic media. Growth is more rapid in media containing blood or tissue fluids and fastest at 30°C. In cultures on blood agar at 37°C, colonies may be very small at 24 hours. A virulent inoculum, derived from infected tissue, produces gray and viscous colonies, but after passage in the laboratory, the colonies become irregular and rough. The organism has little biochemical activity, and this is somewhat variable. Option: D. Shigellae are slender gram-negative rods; coccobacillus forms occur in young cultures. Shigellae are facultative anaerobes but grow best aerobically. Convex, circular, transparent colonies with intact edges reach a diameter of about 2 mm in 24 hours. All shigellae ferment glucose. With the exception of Shigella sonnei, they do not ferment lactose. The inability to ferment lactose distinguishes shigellae on differential media. Shigel- lae form acid from carbohydrates but rarely produce gas. They may also be divided into those organisms that ferment mannitol and those that do not</p>\n<p><strong>Extraedge:</strong></p><p>The IMViC tests are a group of individual tests used in microbiology lab testing to identify an organism in the coliform group. A coliform is a gram negative, aerobic, or facultative anaerobic rod, which produces gas from lactose within 48 hours. The presence of some coliforms indicate fecal contamination.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old girl was taken to a hospital with complaints of bloody diarrhea and abdominal pain. She told the resident doctor that she had beef hamburgers yesterday at a restaurant. On examination, doctor noted mild abdominal tenderness, Temp.-98.5 F, Pulse - 70/min, BP- 110/70 mmHg. Which of these statements is incorrect regarding the causative organism of this condition?", "options": [{"label": "A", "text": "Produces exotoxin similar to Shiga toxin", "correct": false}, {"label": "B", "text": "Sereny test is positive", "correct": true}, {"label": "C", "text": "O157:H7 serotype produces clear colonies on MacConkey Agar", "correct": false}, {"label": "D", "text": "Non-O157 strains ferment sorbitol", "correct": false}], "correct_answer": "B. Sereny test is positive", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sereny test is positive Sereny test is positive in cases of Enteroinvasive E coli NOT EHEC. Hence option b) is the answer.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. The given history is suggestive of EHEC (Entero Haemorrhagic E coli) infection leading to Haemorrhagic Colitis. Points in favor are - Bloody diarrhea after eating beef hamburger previous day (Incubation period is more than 16 hrs) - Abdominal pain without fever It produces exotoxin similar to Shiga toxin of Shigella dysenteriae Type 1 known as Verocytotoxin or Shiga-like toxin (SLT). Therefore, EHEC is also known as STEC (Shiga like Toxin producing E coli). Options: C and D. All statements are true for EHEC. -O157:H7 strain produce clear colonies on MacConkey agar is a true statement (option c). -Mostly H7:O157 serotype of EHEC do not ferment sorbitol. But some O157 and almost all non O157 strain ferment sorbitol (option d)</p>\n<p><strong>Extraedge:</strong></p><p>Sereny test (The Sereny test is a test used to test the invasiveness of organisms) It is done by inoculating suspension of bacteria into guinea pig's eye. Severe mucopurulent conjunctivitis and severe keratitis indicates a positive test. Sereny test is done for: 1) Enterolnvasive E.coli 2) Shigella 3) Listeria monocytogenes etc...</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statement regarding Campylobacter jejuni is not correct?", "options": [{"label": "A", "text": "It is commonly cultured in antibiotic containing media", "correct": false}, {"label": "B", "text": "Incubation temperature is 42? C", "correct": false}, {"label": "C", "text": "It is cultured in an atmosphere containing 5% O2 and 10% CO2.", "correct": false}, {"label": "D", "text": "It is a normal flora of human intestine", "correct": true}], "correct_answer": "D. It is a normal flora of human intestine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It is a normal flora of human intestine Campylobacter species are GN (Gram Negative) curved and motile usually via unipolar flagellum. Campylobacter is found in intestine of many animals. The main source of C. jejuni and C. coli infection in humans is poultry, although dogs, cats, and hamsters are also potential sources. The most common routes of transmission are fecal-oral, ingestion of contaminated food or water, and the eating of raw meat. The isolation and identification of Campylobacter jejuni can be achieved using special culture characteristics. Three requirements must be met.</p>\n<p><strong>Highyeild:</strong></p><p>General Characteristics Gram-negative, curved, spiral-shaped, S-shaped rods Non-sporing Motile (polar flagella) Oxidase positive Microaerophilic (grow best at 5% O½ 10% CO2, 85% N2) at 42 ° C</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. - selective medium is needed . There are several selective media in widespread use: Skirrow's medium uses vancomycin, polymyxin B, and trimethoprim in 7% lysed blood agar; other selective media contain cefoperazone, other antimicrobials, and inhibitory compounds. Option: B. The selective media are suitable for isolation of C. jejuni at 42°C (107.6°F); when incubated at 36-37°C (96.8-98.6 °F), other Campylobacters and bacteria may be isolated. Option: C. Finally, incubation must be in an atmosphere with reduced oxygen (microaerophilic) and added carbon dioxide. The colonies appear to be colorless or grey and may be watery and spreading or round and convex.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is an important distinguishing characteristic of H. pylori as compared to Campylobacter species?", "options": [{"label": "A", "text": "Oxidase production", "correct": false}, {"label": "B", "text": "Catalase production", "correct": false}, {"label": "C", "text": "Urease production", "correct": true}, {"label": "D", "text": "Curved shape", "correct": false}], "correct_answer": "C. Urease production", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Urease production Urease production. Urease production is the distinguishing factor of H. pylori, and it is the basis of the rapid urease breath test that diagnoses H. pylori infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and D. Both Campylobacter species and H. pylori have a curved shape, are oxidase and catalase positive, with polar flagellum.</p>\n<p><strong>Extraedge:</strong></p><p>The urease test identifies those organisms that are capable of hydrolyzing urea to produce ammonia and carbon dioxide. It is primarily used to distinguish urease-positive Proteeae from other Enterobacteriaceae. Two media types are commonly used to detect urease activity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 44 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 40-year-old diabetic male has been in the post-operative surgery ward with a central line inserted for the past eight days. He develops a high-grade fever, cough, and confusion. On examination, his respiratory rate is 32/min, and his BP is 100/70 mmHg. Laboratory results show raised blood counts and 1,3 Beta D Glucan levels > 80 pg/ml. Which of the following is not a likely cause of his condition?", "options": [{"label": "A", "text": "Invasive Aspergillosis", "correct": false}, {"label": "B", "text": "Invasive Candida infection", "correct": false}, {"label": "C", "text": "Invasive Cryptococcosis", "correct": true}, {"label": "D", "text": "Disseminated Pneumocystis infection", "correct": false}], "correct_answer": "C. Invasive Cryptococcosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Invasive Cryptococcosis Invasive Cryptococcosis is not defected by 1,3 Beta D Glucan. The given scenario is a case of Invasive fungal infection.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogens + Inference 1,3 B-D-glucan Galactomannan Most fungi excluding mucor and crytococci. Primarily studied for candida, aspergillosis, and pneumocystis Most specific for diagnosing invasive aspergillosis (IA), reacts inconsistently in other fungi False positives²: ● Patients on hemodialysis (cellulose membranes) ● Glucan-containing gauzes and surgical sponges, surgical patients ● Albumin infusions ● Some beta-lactams False positives5: ● Beta lactam antibiotics ● Guar gum and soy polysaccharides (both in enteral nutrition) ● Foods (tea, milk, pasta, rice, pepper) ● Aspiration pneumonia ● PLASMALYTE7,8 (IV and BAL) Test Characteristics Se Sp Proven or probable IA Se Sp At risk for PJP 96 84 Serum 61 93 Immunosupp IFI 80 82 BAL 87 89 ICU IFI 91-100 57-94 Study populations: Hematologic malignancy population, fewer studies in solid organ transplant patients. BDG studied in patients with suspected pneumocystis jirovecii pneumonia (PJP). Fewer studies of BDG in non-neutropenic ICU patients.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Aspergillus gives a positive Beta D Glucan Assay. Option B. Candida gives a positive Beta D Glucan test. Option D. Pneumocystis Jiroveci also provides a positive Beta D Glucan test.</p>\n<p><strong>Extraedge:</strong></p><p>Esting serum (a component of blood) or cerebrospinal fluid for cryptococcal antigen is useful as a first test for cryptococcal infection, but the test doesn't tell the difference between Cryptococcus neoformans and Cryptococcus gattii. Culture is traditionally used to tell if a cryptococcal infection is due to C.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You suspect that Blastomyces dermatitidis may cause your patient’s disease. Which of the following findings would be MOST helpful in establishing the diagnosis?", "options": [{"label": "A", "text": "The finding of encapsulated budding cells in spinal fluid", "correct": false}, {"label": "B", "text": "A history of the recent archaeological trip", "correct": false}, {"label": "C", "text": "A positive heterophil agglutination test for the presence of antigen", "correct": false}, {"label": "D", "text": "Finding in sputum of budding yeast with buds attached with a broad base", "correct": true}], "correct_answer": "D. Finding in sputum of budding yeast with buds attached with a broad base", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Finding in sputum of budding yeast with buds attached with a broad base Blastomyces dermatitidis is the causal agent of blastomycosis, an invasive and often severe fungal infection found occasionally in humans and other animals in regions where the fungus is endemic. Blastomyces dermatitidis is the causal agent of blastomycosis, an invasive and often severe fungal infection. Blastomyces dermatitidis, a thermally dimorphic fungus, causes blastomycosis. This fungus exists as a mold at room temperature. • The diagnosis of Blastomycosis is confirmed by clinical evaluation that includes chest X-ray studies which may reveal findings that are consistent with fungal pneumonia, i.e., consolidation or cavitation. The direct microscopic examination of infected material, i.e., pus, sputum, or urine, is also performed.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - The finding of encapsulated budding cells in spinal fluid - is not the most useful diagnosis. Option B - A history of the recent archaeological trip - no relevance here Option C - it is for EBV, not for Blastomyces. Options A, B and C are not the characteristics of Blastomyces.</p>\n<p><strong>Extraedge:</strong></p><p>Localized infection is usually treated with topical antifungal agents, whereas disseminated infection requires the use of systemic agents with or without surgical debridement, and in some conditions immunotherapy is also advisable.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 12 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A patient who has been diagnosed with sarcoidosis experiences severe hemoptysis. Imaging studies are strongly suggestive of bronchiectasis and cavitation. In addition, several movable masses are detected within the cavitation. Surgical resection of the affected area is performed, and the contents of these cavitary masses are cultured. A microscopic view of the 3-day culture is shown in the image. Which of the following microbes was isolated?", "options": [{"label": "A", "text": "Aspergillus", "correct": true}, {"label": "B", "text": "Candida", "correct": false}, {"label": "C", "text": "Cryptococcus", "correct": false}, {"label": "D", "text": "Pneumocystis", "correct": false}], "correct_answer": "A. Aspergillus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689247883739-QTDV054001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus Movable cavitary mass and hemoptysis in a patient with a history of sarcoidosis strongly suggest aspergillomas . Pre Existing conditions, such as tuberculosis, emphysema, or sarcoidosis, which promote pulmonary cavitation, are linked to the condition. Usually, the infection is non-invasive and may spontaneously resolve when the underlying condition is corrected. Itraconazole may be indicated if the patient is not a viable candidate for surgery. The microscopic structure in the image is a conidiophore characteristic of Aspergillus . By contrast, Rhizopus features a sporangium; Candida and Cryptococcus produce budding yeast cells; and a diagnosis of Pneumocystis would be supported only if cysts and trophozoites were observed in stained sections of lung tissue.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B Option C Option D</p>\n<p><strong>Extraedge:</strong></p><p>Candidiasis and aspergillosis are the most common fungal infections in immunocompromised hosts. The spectrum of disease ranges from superficial and mucosal infections to invasive tissue infection</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "This 54-year-old HIV-positive woman on ART presented to a large teaching hospital with a 2-week history of fevers, difficulty breathing, and a non-productive cough. A 3-week history of malaise, nausea, and sharp chest and back pains preceded this. There was no history of palpitations or radiation of chest pain. She described a 9-month history of unintentional weight loss of 3–4 kg, with an accompanying loss in appetite and odynophagia.CD4 quantification revealed 12 cells/mm3, consistent with an advanced presentation of HIV. Sputum smear was stained with gomori methenamine silver stain, which shows the following finding which of the following is the causative organism responsible for a patient's condition?", "options": [{"label": "A", "text": "Pneumocystis jiroveci", "correct": true}, {"label": "B", "text": "Cryptococcus pneumonia", "correct": false}, {"label": "C", "text": "Histoplasmosis", "correct": false}, {"label": "D", "text": "Para coccidioidomycosis", "correct": false}], "correct_answer": "A. Pneumocystis jiroveci", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689247888250-QTDV054004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pneumocystis jiroveci -->GMS-stained sputum smear reveals black cysts in the green background, which is suggestive of pneumocystis jiroveci. --> Pneumocystis jiroveci is one of the most common organisms causing pneumonia in HIV-positive individuals</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B -> Cryptococcus neoformans is a capsulated fungus characterised by causing meningitis in HIV-positive individuals. Option C -> Histoplasmosis is a dimorphic fungus causing respiratory infection characterised by producing trabeculated macroconidia. Option D ->Para coccidioidomycosis is associated with pulmonary infections and is characterised by producing multipolar budding yeast cells called pilot wheel appearance.</p>\n<p><strong>Extraedge:</strong></p><p>Pneumocystis jirovecii is a yeast-like fungus of the genus Pneumocystis. The causative organism of Pneumocystis pneumonia, it is an important human pathogen, particularly among immunocompromised hosts. Prior to its discovery as a human-specific pathogen, P. jirovecii was known as P. carinii.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statement is false regarding pneumocystis jiroveci Pneumonia?", "options": [{"label": "A", "text": "Pneumocystis jiroveci organism can be cultured in SDA agar", "correct": true}, {"label": "B", "text": "KOH mount of sputum sample reveals cysts of pneumocystis jiroveci", "correct": false}, {"label": "C", "text": "Gomori methenamine silver stain shows black cocolourysts is in green color background", "correct": false}, {"label": "D", "text": "Pneumocystis jiroveci is characterised by causing atypical pneumonia in HIV-positive individuals", "correct": false}], "correct_answer": "A. Pneumocystis jiroveci organism can be cultured in SDA agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pneumocystis jiroveci organism can be cultured in SDA agar -->pneumocystis jiroveci cannot be cultured. It is a non-cultivable organism</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B - KOH mount of sputum sample reveals cysts of pneumocystis jiroveci - True Option C - Gomori methenamine silver stain reveals black color cysts in the green color background - True Option D - Pneumocystis jiroveci is characterised by causing atypical pneumonia in HIV - positive individuals - True --> All the statements are true regarding pneumocystis jiroveci.</p>\n<p><strong>Extraedge:</strong></p><p>Pneumocystis jirovecii is a yeast-like fungus of the genus Pneumocystis. The causative organism of Pneumocystis pneumonia, it is an important human pathogen, particularly among immunocompromised hosts. Prior to its discovery as a human-specific pathogen, P. jirovecii was known as P. carinii</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient with AIDS has a persistent cough and has shown progressive behavioural changes in the past few weeks. CSF sample is collected, and an encapsulated, yeastlike organism is observed. Based only on these observations, what is the most likely organism?", "options": [{"label": "A", "text": "Candida", "correct": false}, {"label": "B", "text": "Cryptococcus", "correct": true}, {"label": "C", "text": "Cryptosporidium", "correct": false}, {"label": "D", "text": "Pneumocystis", "correct": false}], "correct_answer": "B. Cryptococcus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptococcus Cryptococcus, sometimes informally called crypto, is a genus of fungi that grow in culture as yeasts. The sexual forms or teleomorphs of Cryptococcus species are filamentous fungi in the genus Filobasidiella. In HIV-infected patients, cryptococcosis commonly presents as subacute meningitis or meningoencephalitis with fever, malaise, and headache. Classic meningeal symptoms and signs, such as neck stiffness and photophobia, occur in only one-quarter to one-third of patients. Cryptococcus neoformans is an encapsulated yeast that remains an important pathogen, particularly among patients with the human immunodeficiency virus (HIV). A rare disease before the HIV epidemic, Cryptococcus is now among the leading causes of meningitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A Option D Option A, C and D are not the correct organisms involved in this case.</p>\n<p><strong>Extraedge:</strong></p><p>Cryptococcal meningitis is an infection caused by the fungus Cryptococcus after it spreads from the lungs to the brain. The symptoms of cryptococcal meningitis include: Headache. Fever. Neck pain.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A Brazilian immigrant is hired at a meat packing plant and undergoes a physical examination. Chest X-ray demonstrates patchy bilateral pneumonia and a lung mass. Biopsy of the mass demonstrates fungal organisms with a few very distinctive ‘ pilot’s wheel’ yeast forms. What is the most likely diagnosis:", "options": [{"label": "A", "text": "Blastomycosis", "correct": false}, {"label": "B", "text": "Coccidioidomycosis", "correct": false}, {"label": "C", "text": "Histoplasmosis", "correct": false}, {"label": "D", "text": "Paracoccidioidomycosis", "correct": true}], "correct_answer": "D. Paracoccidioidomycosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Paracoccidioidomycosis Paracoccidioidomycosis (PCM) is a chronic infectious tropical disease caused by the fungus Paracoccidioides brasiliensis. The initial infection usually occurs in the lungs, but may also spread to the skin, mucous membranes, and other parts of the body. . Paracoccidioidomycosis is an infection caused by the fungus Paracoccidioides. This fungus lives in parts of Central and South America. Paracoccidioidomycosis (PCM) is an acute to chronic fungal infection caused by fungi in the genus Paracoccidioides, including Paracoccidioides brasiliensis and Paracoccidioides lutzii. It is endemic to Central and South America, and is considered to be a neglected endemic mycosis, a type of neglected tropical disease. Pilot's wheel-like appearance of yeasts observed in a lactophenol cotton blue in Pulmonary Paracoccidioidomycosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A Option B Option C Option A, B and C are not associated with this specific finding.</p>\n<p><strong>Extraedge:</strong></p><p>HIV damages the immune system. A weakened immune system makes it harder for the body to fight off OIs. HIV-related OIs include pneumonia, Salmonella infection, candidiasis, toxoplasmosis, and tuberculosis (TB). For people with HIV, the best protection against OIs is to take HIV medicines every day.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 18-year-old student develops a fever, cough and chest pain. Lymph node biopsy revealed granulomatous inflammation and macrophages engorged with oval structures measuring 2-4 ↗m. the student has most likely acquired an infection from:", "options": [{"label": "A", "text": "Desert sand", "correct": false}, {"label": "B", "text": "Cat feces", "correct": false}, {"label": "C", "text": "Soil enriched with bird excrement", "correct": true}, {"label": "D", "text": "Another human via the respiratory tract", "correct": false}], "correct_answer": "C. Soil enriched with bird excrement", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Soil enriched with bird excrement Histoplasmosis is a fungal infection that can affect anyone. Histoplasmosis is caused by Histoplasma, a fungus that lives in the soil, mainly where there's a large amount of bird or bat poop. Histoplasmosis is a type of lung infection. It is caused by inhaling Histoplasma capsulatum fungal spores . These spores are found in the soil and the droppings of bats and birds. This fungus mainly grows in the central, southeastern, and mid-Atlantic states. Most cases of histoplasmosis don't require treatment. Histoplasmosis is an infection caused by a fungus called Histoplasma. The fungus lives in the environment. Histoplasmosis is an infection caused by breathing in spores of a fungus often found in bird and bat droppings. Among the pathogenic fungi, Histoplasma capsulatum Darling is one of the most thoroughly studied. The saprophytic phase of this dimorphic fungus is characterised by the formation of tuberculate spores on aerial hyphae at the surface of the mycelium. Options A, B and D are not the correct diagnosis.</p>\n<p><strong>Extraedge:</strong></p><p>Symptoms of Histoplasmosis Fever Cough Fatigue (extreme tiredness) Chills Headache Chest pain. Body aches.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Amphotericin B injection is used to treat serious and potentially life-threatening fungal infections. Amphotericin B injection is in a class of medications called antifungals. It works by slowing the growth of fungi that cause infection. Amphotericin-B is used as:", "options": [{"label": "A", "text": "As a reserve drug in Kala Azar", "correct": false}, {"label": "B", "text": "In systemic mycosis", "correct": false}, {"label": "C", "text": "Both are correct", "correct": true}, {"label": "D", "text": "Both are incorrect", "correct": false}], "correct_answer": "C. Both are correct", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both are correct Option A - Amphotericin B deoxycholate has been used in India to treat visceral leishmaniasis (kala-azar) for >1 decade. Its rediscovery as an effective treatment for Leishmania donovani infection was spawned by developing large-scale resistance to conventional pentavalent antimony therapy in Bihar State. Amphotericin B is a polyene antifungal agent with activity in vitro against various fungal pathogens. Option B - Despite introducing newer antifungal agents for systemic mycoses, amphotericin B remains the standard treatment for many severe, invasive fungal infections. Liposomal amphotericin B has been used increasingly frequently to treat visceral leishmaniasis (VL). It is the treatment of choice for immunocompetent patients in the Mediterranean region and the preferred drug for HIV/VL co-infection.</p>\n<p><strong>Extraedge:</strong></p><p>Amphotericin B is an antifungal medication used for serious fungal infections and leishmaniasis. The fungal infections it is used to treat include mucormycosis, aspergillosis, blastomycosis, candidiasis, coccidioidomycosis, and cryptococcosis. For certain infections it is given with flucytosine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 17 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Clostridium perfringens bacteria are one of the most common causes of foodborne illness (food poisoning). C. perfringens can be found on raw meat and poultry, in the intestines of animals, and in the environment. Regarding Clostridium perfringens gas gangrene false is:", "options": [{"label": "A", "text": "Clostridium perfringens is the most common cause of gas gangrene", "correct": false}, {"label": "B", "text": "Naegler reaction positive", "correct": false}, {"label": "C", "text": "Most important toxin is hyaluronidase", "correct": true}, {"label": "D", "text": "Food poisoning strain of clostridium perfringens produces heat-labile spores.", "correct": false}], "correct_answer": "C. Most important toxin is hyaluronidase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Most important toxin is hyaluronidase The most important virulence factor is the toxin known as Clostridium perfringens enterotoxin (CPE), while the biological properties of this bacterium also contribute to the induction of foodborne disease. Perfringens produce toxins that kill cells and release gas, leaving parts of the body black, purple, and covered with blisters. Alpha toxin (or lecithinase or phospholipase C) is the principal virulence factor for gas gangrene.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Gas gangrene is most commonly caused by the Clostridium perfringens bacterium. The infection occurs suddenly and spreads quickly. Gas gangrene generally develops at a recent surgery or injury site. Bacteria cause myonecrosis. These microorganisms are opportunistic and, in general, enter the body through significant skin breakage Option B. Gas gangrene has positive naegler reaction. Option D. The C. perfringens enterotoxin (CPE) mediating the disease is heat-labile (inactivated at 74 °C (165 °F)). It can be detected in contaminated food (if not heated properly), and feces. Incubation time is between 6 and 25 (commonly 10–12) hours after ingestion of contaminated food.</p>\n<p><strong>Extraedge:</strong></p><p>Toxins of clostrium perfringens The alpha toxin - lecithinase, and its lethal action are proportionate to the rate at which it splits lecithin (an important constituent of cell membranes) to phosphorylcholine and diglyceride. The alpha toxin also aggregates platelets, thereby leading to the formation of thromb i in small blood vessels causing poor tissue profusion and extending the consequences of anaerobiosis, i.e. gas gangrene. The theta toxin has hemolytic and necrotizing effects but is not a lecithinase. It is a member of the cholesterol-dependent cytolysins that act by forming pores in cell membranes. Epsilon toxin is a protein that causes edema, and haemorrhage is very potent. DNase and hyaluronidase, a collagenase that digests collagen of subcutaneous tissue and muscle, are also produced. Lecithinase test or Nagler's reaction Is a biochemical test used to identify organisms that liberate phospholipases (lecithinases) e.g. Clostridium perfringens. Options A, B and D. Are correct statements about gas gangrene.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Clostridium is a genus of Gram-positive bacteria. This genus includes several significant human pathogens, including the causative agents of botulism and tetanus. Which species of clostridium does not cause gas gangrene-", "options": [{"label": "A", "text": "C. perfringens", "correct": false}, {"label": "B", "text": "C. histolyticum", "correct": false}, {"label": "C", "text": "C. novyi", "correct": false}, {"label": "D", "text": "C. sporogenes", "correct": true}], "correct_answer": "D. C. sporogenes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. sporogenes Gas gangrene is defined as a rapidly spreading, edematous myonecrosis, occurring in association with severely crushed wounds contaminated with pathogenic clostridia, particularly with C. perfringens. It is mostly polymicrobial.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B & C. Established agents: C. perfringens (MC, 60%) and C. novyi and C. septicum (20–40%). Option D. Probable causal agents: C. histolyticum, C. sporogenes, C. fallax, C. bifermentans, C. sordellii, C. aerofoetidum and C. tertium. Options A, B & C. These are the causes of gas gangrene.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Citron bodies” boat or leaf-shaped pleomorphic organism in an exudate are seen in infection by which of the following?", "options": [{"label": "A", "text": "Psittacosis", "correct": false}, {"label": "B", "text": "Molluscum contagiosum", "correct": false}, {"label": "C", "text": "Clostridium septicum", "correct": true}, {"label": "D", "text": "Clostridium tetani", "correct": false}], "correct_answer": "C. Clostridium septicum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium septicum Citron bodies - Boat or leaf-shaped pleomorphic bacteria, usually associated with clostridium septicum . These are Gram-positive, anaerobic bacteria that cause gas gangrene. Clostridium septicum. Molluscum contagiosum: is caused by a poxvirus. Molluscum contagiosum lesions are flesh-coloured, dome-shaped, and pearly in appearance. They are often 1–5 mm in diameter, with an umbilicated centre. Psittacosis is caused by Chlamydia psittaci. They produce diffuse intracytoplasmic inclusions and lack glycogen and are resistant to sulfonamides. It includes agents of psittacosis in humans, ornithosis in birds, and feline pneumonitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. C. tetani do not cause citron bodies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old male was admitted to an emergency with shock. He had a history of road traffic accidents multiple open wounds and a crush injury, 3 days before. There was discolouration and, oedema and serous discharge at the site of injury. On palpation, crepitus was present around the wound. Wound discharge was collected and sent for bacterial examination. Direct microscopy from the discharge shows brick-shaped gram-positive bacilli and no inflammatory cells as shown below. What is the most probable causative agent?", "options": [{"label": "A", "text": "Clostridium difficile", "correct": false}, {"label": "B", "text": "Clostridium perfringens", "correct": true}, {"label": "C", "text": "Clostridium tetani", "correct": false}, {"label": "D", "text": "Clostridium botulinum", "correct": false}], "correct_answer": "B. Clostridium perfringens", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689250638961-QTDV064004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium perfringens above case scenario is suggestive of invasive infection i.e. Gas Gangrene. Clostridium perfringens is the most common cause of gas gangrene followed by C.novyi, C.septicum and the least common C.histolyticum. Clostridium perfringens. Thick, stubby, brick/ boxcar-shaped, capsulated gram-positive bacilli. The absence of neutrophils is the characteristics feature as its a toxin-mediated response.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Clostridium difficile is a gram-positive spore-forming bacillus that causes diarrhoea and pseudomembranous colitis. It is not associated with such a disease presentation. Option C. Clostridium tetani on Gram staining reveals gram-positive bacilli with terminal and round spores (drumstick appearance) Option D. Clostridium botulinum, is gram-positive, with sub-terminal oval bulging spores. It produces a toxin called botulinum toxin causing the disease botulism.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 64-year-old male was admitted to emergency with a history of a road traffic accident having multiple open wounds and crush injury of the lower limbs, 3 days before. There was discolouration and, oedema and serous discharge at the site of injury. On palpation, crepitus was present around the wound. Emergency Medical officers suspect anaerobic infection and decided to collect samples for diagnosis. What is the most suitable specimen for culture?", "options": [{"label": "A", "text": "Pus swab from the wound", "correct": false}, {"label": "B", "text": "Muscle tissue from the wound", "correct": false}, {"label": "C", "text": "Pus swab collected in Robertson’s cooked meat media", "correct": false}, {"label": "D", "text": "Muscle tissue collected in Robertson’s cooked meat media", "correct": true}], "correct_answer": "D. Muscle tissue collected in Robertson’s cooked meat media", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Muscle tissue collected in Robertson’s cooked meat media The above case scenario is suggestive of invasive infection suggestive of Gas Gangrene. Clostridium perfringens is the most common cause of gas gangrene followed by C.novyi, C.septicum and the least common C.histolyticum. This question explores the best possible ways to make a microbiological diagnosis. Culture is better achieved with muscle tissue as the organism resides in it. Pus swabs though can be used for gram stain, and aren’t a preferred sample for culture. Materials from wounds, pus and tissue, where infection is more active are the ideal specimens for the isolation of Clostridium perfringens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Specimens should be put into Robertson’s cooked meat broth (anaerobic media) and transported immediately to the laboratory. Option A & C. Swabs rubbed over the wound or soaked in discharge are not suitable specimens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old male was admitted to an emergency with shock. He had a history of a road traffic accident having multiple open wounds and crush injury of the lower limbs, 3 days before. There was discolouration, edema and serous discharge at the site of injury. On palpation, crepitus was present around the wound. Emergency Medical officers suspect an infection due to C.perfringens. Which of the following statement is not true about C.perfringens?", "options": [{"label": "A", "text": "Commonest cause of gas gangrene.", "correct": false}, {"label": "B", "text": "Is the gram-positive, capsulated non-motile anaerobe.", "correct": false}, {"label": "C", "text": "Alpha toxin is the principal virulence factor.", "correct": false}, {"label": "D", "text": "Incubation period is 5-6 days.", "correct": true}], "correct_answer": "D. Incubation period is 5-6 days.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Incubation period is 5-6 days. The incubation period of C.perfringens is 10-48 hours.</p>\n<p><strong>Highyeild:</strong></p><p>Gas Gan g rene Aetiology and pathogenesis Gas gangrene occurs by muscle injury and contamination of the wound by soil or foreign material containing clostridial spores. C. perfringens is the predominant cause (80– 95%), and its pathology is mediated by α and λ toxins. Spontaneous or non-traumatic gas gangrene may occur in any obvious absence wound. Mainly caused by C. septicum and is seen with intestinal abnormalities, e.g. colonic cancer, diverticulitis, etc. Other organisms include C. novyi, C. bifermentans, C. histolyticum, and C. fallux. Clinical features The incubation period is usually 2– 3 days but may be shorter. Patients present with acute onset of excruciating pain and signs of shock. Early signs- Local oedema and tenderness and a serosanguinous, foulsmelling discharge, crepitus (due to the gas formation), skin discolouration, and necrosis, associated with rapid progression. Diagnosis Is usually clinical but may be confirmed by Gram stain of the wound or aspirate. Liquid anaerobic cultures may be positive within 6h. Plain radiographs may show gas in the affected tissues. Management Emergency surgical exploration and debridement of the affected area should be performed. The definitive treatment for clostridial myonecrosis is with penicillin and clindamycin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Clostridium perfringens (60%) is the most common cause of gas gangrene followed by C. novyi, C.septicum (20-40%) and the least common C.histolyticum. Option B. Clostridium perfringens is Thick, stubby, brick/ boxcar-shaped, capsulated gram-positive bacilli. The absence of neutrophils is the characteristic feature. Option C. Perfringens produces 4 major toxins: alpha, beta, epsilon and iota. Alpha toxin is the main virulence factor with both phospholipase C and sphingomyelinase activity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old male was admitted to an emergency with shock. He had a history of a road traffic accident having multiple open wounds and crush injury of the lower limbs, 3 days before. There was discolouration, edema and serous discharge at the site of injury. On palpation, crepitus was present around the wound. Emergency Medical officers suspect an infection due to C.perfringens. Deep wound discharge was collected and sent for bacteriological examination. The test was performed as shown below. Identify the test and interpretation:", "options": [{"label": "A", "text": "CAMP test positive", "correct": false}, {"label": "B", "text": "CAMP test negative", "correct": false}, {"label": "C", "text": "Reverse camp test positive", "correct": true}, {"label": "D", "text": "Reverse camp test negative", "correct": false}], "correct_answer": "C. Reverse camp test positive", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689250640754-QTDV064008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Reverse camp test positive C. perfringens can be identified by reverse CAMP test, in which C.perfringens is streaked over the centre of the Blood agar plate and Streptococcus agalactiae is streaked perpendicular to it.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option s A and B. CAMP test is usually performed for S.agalactiae, in which Streptococcus agalactiae is streaked over the centre of the Blood agar plate and Staphylococcus aureus is streaked perpendicular to it. (See below) The presence of an enhanced zone of hemolysis (butterfly-shaped) indicates the test is positive. The absence of an enhanced zone of hemolysis (butterfly-shaped) indicates the test is Negative. Option D. This is a positive test</p>\n<p><strong>Extraedge:</strong></p><p>CAMP TEST: named after Christie, Atkins, and Munch– Petersen Enhanced zone of hemolysis due to a mechanism of synergistic haemolysis with the β- lysin of S. aureus on sheep blood agar plate and the hemolysin of streptococcus agalactiae. CAMP Positive: S. agalactiae (triangular shape) Listeria monocytogens. (Rectangular shape- lesser zone of hemolysis than the streptococcal zone) Reverse CAMP Positive: c. perfringens</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 17 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Which of the following is the most likely function of this bacterial cell wall- associated protein?", "options": [{"label": "A", "text": "Excrete antibiotics", "correct": false}, {"label": "B", "text": "Protect from osmotic lysis", "correct": false}, {"label": "C", "text": "Provide mechanical cell support", "correct": false}, {"label": "D", "text": "Resist phagocytosis", "correct": true}], "correct_answer": "D. Resist phagocytosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Resist phagocytosis Gram-positive organisms have cell walls composed primarily of a thick peptidoglycan layer and teichoic acid. However, additional cell wall components are often present that contribute to virulence, motility, or the ability to adhere to epithelial surfaces. For instance, the cell wall of group A streptococcus (also known as Streptococcus pyogenes) is studded with M protein, a virulence factor that inhibits phagocytosis, prevents complement binding, and aids in epithelial attachment. M protein is an alpha-helical coiled-coil protein that shares epitopes and structural homology with other alpha-helical coiled-coil proteins such as tropomyosin and myosin. In some patients, the protective antibodies against M protein that develop in S pyogenes acute infection may cross react with myosin epitopes in the heart and cause rheumatic carditis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Efflux pumps are generally globular proteins with multiple domains. They reside in the bacterial cell membrane and excrete toxic substances from the interior of the cell. Bacteria can use efflux pumps to generate antibiotic resistance to drugs that operate in the interior of the cell, such as fluoroquinolones and aminoglycosides. Option B and C. The bacterial cell wall provides mechanical support and protects it from osmotic lysis. It is composed primarily of peptidoglycan, which forms a mesh-like, cross-linked polymer of peptides and sugars.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 22-year-old male presents to the emergency department complaining of fever, abdominal pain, and vomiting. He has had these symptoms for the past four days but has not sought medical attention because of concerns over the cost of treatment. On examination, the patient appears acutely ill. There is right lower quadrant tenderness with the rebound as well as a palpable mass. CT scan of the abdomen and pelvis demonstrates a peri appendiceal fluid collection. The culture of this fluid would most likely isolate which of the following organisms?", "options": [{"label": "A", "text": "Staphylococcus aureus", "correct": false}, {"label": "B", "text": "Actinomyces", "correct": false}, {"label": "C", "text": "Candida albicans", "correct": false}, {"label": "D", "text": "Bacteroides fragilis", "correct": true}], "correct_answer": "D. Bacteroides fragilis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacteroides fragilis This patient is suffering from perforated appendicitis that has evolved into an intra-abdominal abscess. Although most infections within the abdominal cavity are polymicrobial, B. fragilis is a common anaerobic gram-negative bacillus that is frequently isolated , and of the choices given, it is the most likely organism to be identified in the culture of this patient's abscess. This organism expresses unique surface polysaccharides that have been shown to favor abscess formation. In addition to B. fragilis, common bacterial isolates from intra-abdominal infections include other members of the normal colonic flora such as Escherichia coli, enterococci, and streptococci.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. S. aureus is a gram-positive organism that can cause abscess formation on the skin, but is not typically isolated from an intraabdominal abscess. Option B. Actinomyces species are anaerobic bacteria that can form abscesses in the cervicofacial region or abdominal cavity. However, they are much less common than B. fragilis and typically do not form abscesses this quickly. Option C. Candida albicans can be isolated from an infection resulting from perforation of the proximal bowel such as a perforated peptic ulcer.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about Listeria monocytogenes except:", "options": [{"label": "A", "text": "Negative cocci", "correct": true}, {"label": "B", "text": "Tumbling motility", "correct": false}, {"label": "C", "text": "May cause Differential motility", "correct": false}, {"label": "D", "text": "Anton’s test positive", "correct": false}], "correct_answer": "A. Negative cocci", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Negative cocci Listeria monocytogenes is a Gram-positive coccobacilli (rod-shaped), in the division Firmicutes, named after Joseph Lister.</p>\n<p><strong>Highyeild:</strong></p><p>LISTERIA Can grow at temperatures as low as 0 °C permits multiplication at typical refrigeration temperatures, greatly increasing its ability to evade control in human food. Listeriosis is a serious infection usually caused by eating food contaminated with the bacterium Listeria monocytogenes. It is catalase-positive and oxidase-negative and expresses a beta hemolysin, which causes the destruction of red blood cells causing weak beta hemolysis. Shows tumbling– a type of motility(option B) Motile at 25°C but non motile at 37°C (Differential motility)(option C) Growth improves if cultured in thioglycollate broth at 4°C (cold enrichment) Anton's test is positive. The Anton test is used in the identification of L. monocytogenes; instillation of a culture into the conjunctival sac of a rabbit or guinea pig causes severe keratoconjunctivitis within 24 hours.(option D)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All the following are true about Listeria except:", "options": [{"label": "A", "text": "Eating raw refrigerated cucumber.", "correct": false}, {"label": "B", "text": "Gram-negative bacteria", "correct": true}, {"label": "C", "text": "Causes abortion in pregnancy", "correct": false}, {"label": "D", "text": "Causes meningitis in neonates", "correct": false}], "correct_answer": "B. Gram-negative bacteria", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gram-negative bacteria Listeria monocytogenes is a Gram-positive bacterium, in the division Firmicutes, named after Joseph Lister.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. Are correct. Option A. Its ability to grow at temperatures as low as 0 °C permits multiplication at typical refrigeration temperatures, greatly increasing its ability to evade control in human foodstuffs. Listeriosis is a serious infection usually caused by eating food contaminated with the bacterium Listeria monocytogenes. It can cause serious illness especially in elderly, immunocompromised, and in pregnancy . Options C and D. Listeria cause meningitis in neonates and Chorioamnionitis which leads to abortion in pregnancy. It is catalase-positive and oxidase-negative and expresses a beta hemolysin, which causes destruction of red blood cells. Listeria monocytogenes is a Gram-positive rod-shaped bacterium.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements about type II restriction enzymes is false?", "options": [{"label": "A", "text": "Produce recombinant DNAs.", "correct": false}, {"label": "B", "text": "Some cut DNA to generate blunt ends. Produce discrete restriction fragments.", "correct": false}, {"label": "C", "text": "They are part of a bacterial defense system in which foreign DNA is cleaved. Cut DNA at defined positions close to or within their recognition sequences.", "correct": false}, {"label": "D", "text": "They cleave and ligate DNA", "correct": true}], "correct_answer": "D. They cleave and ligate DNA", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>They cleave and ligate DNA They cleave but do not ligate DNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. Are correct- Type II restriction endonucleases always cleave at or near their recognition sites. Option A. They produce small, well-defined fragments of DNA that help to characterize genes and genomes and that produce recombinant DNAs. Fragments of DNA produced by restriction endonucleases can be moved from one organism to another. Option C. Type II enzymes cut DNA at defined positions close to or within their recognition sequences. Option B. They produce discrete restriction fragments and distinct gel banding patterns, and they are the only class used in the laboratory for routine DNA analysis and gene cloning.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following organism does not have a cell wall:", "options": [{"label": "A", "text": "Mycoplasma", "correct": true}, {"label": "B", "text": "Rickettsiae", "correct": false}, {"label": "C", "text": "Chlamydia", "correct": false}, {"label": "D", "text": "Spirochaetes", "correct": false}], "correct_answer": "A. Mycoplasma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mycoplasma Mycoplasma are Filterable, Hence are also known as Eaton’s agent) Formerly called PPLO- Pleuro pneumonia-like organism. Lack of rigid cell wall. The Peptidoglycan layer is absen t; replaced by cholesterol. Hence they are r esistant to cell wall active antibiotics like beta-lactams. They can be parasitic or saprotrophic.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Rickettsiae-rod-shaped, coccoid, and often pleomorphic microorganisms which have typical bacterial cell walls. Option C. The chlamydial cell has a Gram-negative cell wall structure consisting of an outer membrane and an inner cytoplasmic membrane. Option D. Spirochaetes are a large, heterogenous group of the spiral, extremely thin (0.1 microns), and motile bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Amino acids are found in the protein, peptide-glycan, and capsule of bacteria. Which of the following amino acids is found only in peptidoglycan:", "options": [{"label": "A", "text": "L-lysine", "correct": false}, {"label": "B", "text": "Diaminopimelic acid", "correct": true}, {"label": "C", "text": "D-glutamate", "correct": false}, {"label": "D", "text": "L-alanine", "correct": false}], "correct_answer": "B. Diaminopimelic acid", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diaminopimelic acid Peptidoglycan or murein is a polymer consisting of sugars and amino acids that form a mesh-like layer outside the plasma membrane of most bacteria, forming the cell wall. Diaminopimelic acid is found only in plants and microorganisms, which utilize it as an intermediate for l-lysine biosynthesis. The peptidoglycan structure of many bacteria, especially Gram-negative bacteria, contains meso-diaminopimelic acid in position 3 of the pentapeptide side chain.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Endotoxic activity of gram-negative bacteria is present in:", "options": [{"label": "A", "text": "Carbohydrate", "correct": false}, {"label": "B", "text": "Protein", "correct": false}, {"label": "C", "text": "Lipid", "correct": true}, {"label": "D", "text": "Inorganic substances", "correct": false}], "correct_answer": "C. Lipid", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lipid Endotoxins (lipopolysaccharide) are part of the outer membrane of the cell wall of Gram-negative bacteria. Endotoxin is invariably associated with Gram-negative bacteria whether the organisms are pathogenic or not. The relationship of endotoxin (lipopolysaccharide) to the bacterial cell surface.---- Toxicity is associated with the lipid component (Lipid A) and immunogenicity is associated with the polysaccharide components. Toxicity is associated with the lipid component (Lipid A) and immunogenicity is associated with the polysaccharide components. Endotoxin refers to lipopolysaccharide that constitutes the outer leaflet of the outer membrane of most Gram-negative bacteria. Lipopolysaccharide is composed of a hydrophilic polysaccharide and a hydrophobic component known as lipid A which is responsible for the major bioactivity of endotoxin. Lipid A is a lipid component of an endotoxin held responsible for the toxicity of gram-negative bacteria.</p>\n<p><strong>Highyeild:</strong></p><p>STRUCTURE OF POLYSACCHARIDE:</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Endotoxic activity of gram-negative bacteria is not present in these options shown in the image.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In CSF, Limulus amebocyte lysate assay is positive in which of the following:", "options": [{"label": "A", "text": "TBM Tuberculous meningitis", "correct": false}, {"label": "B", "text": "Gram-negative meningitis", "correct": true}, {"label": "C", "text": "Viral meningitis", "correct": false}, {"label": "D", "text": "Chemical meningitis", "correct": false}], "correct_answer": "B. Gram-negative meningitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gram-negative meningitis The Limulus amebocyte lysate (LAL) has been widely used for the d etection of endotoxin in the quality assurance of injectable drugs and medical devices. The LAL constitutes a cascade of serine proteases which are triggered by trace levels of endotoxin, culminating in a gel clot at the end of the reaction. The Limulus lysate assay for detection of endotoxin produced by gram-negative bacteria based on a gelation reaction between lysates of Limulus (horseshoe crab) amebocytes and bacterial endotoxin.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which organism would most likely cause infection after a disinfection procedure that killed vegetative cells but did not kill spores?", "options": [{"label": "A", "text": "Chlamydia", "correct": false}, {"label": "B", "text": "Clostridium", "correct": true}, {"label": "C", "text": "Escherichia", "correct": false}, {"label": "D", "text": "Pseudomonas", "correct": false}], "correct_answer": "B. Clostridium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium Clostridium is a genus of Gram-positive bacteria. This genus includes several significant human pathogens, including the causative agents of botulism and tetanus. Clostridium perfringens cause a wide range of symptoms, from food poisoning to cellulitis, fasciitis, necrotic enteritis, and gas gangrene. Clostridium tetani cause tetanus. Clostridium sordellii can cause a fatal infection in exceptionally rare cases after medical abortions. Chemical disinfectants can kill bacteria, but they do not destroy their spores.</p>\n<p><strong>Highyeild:</strong></p><p>Most of the clostridia bear sub-terminal spores except: C. tetani: Produces spherical and terminal spore (drum stick appearance) C. tertium: Produces oval and terminal spore (tennis racket appearance) C. bifermentans: Produces central and oval spore. Others Option A, C, and D do not produce spores.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Selective inhibition of synthesis of dipicolinic acid would most likely inhibit the formation of:", "options": [{"label": "A", "text": "Bacterial flagella", "correct": false}, {"label": "B", "text": "Bacterial spores", "correct": true}, {"label": "C", "text": "Eukaryotic cilia", "correct": false}, {"label": "D", "text": "Eukaryotic flagella", "correct": false}], "correct_answer": "B. Bacterial spores", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacterial spores Dipicolinic acid is a chemical compound that plays a role in the heat resistance of bacterial endospores. Dipicolinic composes 5% to 15% of the dry weight of bacterial spores. Dipicolinic acid forms a complex with calcium ions within the endospore core. This complex binds free water molecules, causing dehydration of the spore. As a result, the heat resistance of macromolecules within the core increases. Chemical disinfectants can kill bacteria, but they do not destroy their spores.</p>\n<p><strong>Highyeild:</strong></p><p>STRUCTURE OF SPORE</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following bacteria are acid-fast-", "options": [{"label": "A", "text": "Actinomyces", "correct": false}, {"label": "B", "text": "Nocardia", "correct": true}, {"label": "C", "text": "Streptomyces", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "B. Nocardia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nocardia Nocardia is a genus of weakly staining Gram-positive, catalase-positive, rod-shaped bacteria. It forms partially acid-fast beaded branching filaments (acting as fungi, but being truly bacteria). Acid-fast bacteria, also known as acid-fast bacilli or simply AFB, is a group of bacteria sharing the characteristic of acid fastness. Acid fastness is a physical property that gives a bacterium the ability to resist decolorization by acids during staining procedures. Nocardia stain weakly acid-fast, Actinomyces and Streptomyces are not acid-fast</p>\n<p><strong>Highyeild:</strong></p><p>ACID FAST STRUCTURES Very few structures are acid-fast; this makes staining for acid-fastness particularly useful in diagnosis. The following are notable examples of structures which are acid-fast or modified acid-fast: All Mycobacteria - M. tuberculosis, M. leprae, M. smegmatis and atypical Mycobacterium Actinomycetes (especially some aerobic ones) with Mycolic acid in their cell wall (note Streptomyces do NOT have); not to be confused with Actinomyces, which is a non-acid- fast genera of Actinomycetes Nocardia Rhodococcus Gordonia (Actinomycete) Tsukamurella Dietzia Head of sperm Bacterial spores[ Endospore Legionella micdadei Certain cellular inclusions e.g. Cytoplasmic inclusion bodies seen in Neurons in layer 5 of cerebral cortex neuronal ceroid lipofuscinosis (Batten disease). Nuclear inclusion bodies seen in Lead poisoning Bismuth poisoning. Oocysts of some coccidian parasites in faecal matter, such as: Cryptosporidium parvum Isospora belli Cyclospora cayetanensis. A few other parasites: Sarcocystis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and C. These are not acid-fast.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following subspecies of Francisella tularensis is the most virulent for humans?", "options": [{"label": "A", "text": "Tularensis", "correct": true}, {"label": "B", "text": "Holarctica", "correct": false}, {"label": "C", "text": "Mediasiatica", "correct": false}, {"label": "D", "text": "Novicida", "correct": false}], "correct_answer": "A. Tularensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tularensis Francisella tularensis is one of the most infectious pathogens known and is able to cause the disease tularemia after entering the body via a number of routes. Respiratory tularemia is of greatest concern in humans because of the acute nature of the disease. F. tularensis (or type A), is the most virulent of the four known subspecies and is associated with lethal pulmonary infections. F. tularensis subspecies tularensis is the most infectious biovar (ID50 < 10 cfu) phagocytes that have been infected with human-virulent strains of F. tularensis. Gentamicin is considered as the drug of choice. Other drugs used are streptomycin,</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 5-year-old boy presents with a sore throat for the last two days. He is unvaccinated, however, his younger brother is adequately vaccinated. On examination, he has a grayish-white pseudomembrane around his tonsils. Diphtheria is suspected. What prophylactic measure should be adopted for the brother:", "options": [{"label": "A", "text": "Prophylaxis with oral erythromycin", "correct": false}, {"label": "B", "text": "Prophylaxis with erythromycin and diphtheria antitoxin", "correct": false}, {"label": "C", "text": "Nothing is required", "correct": true}, {"label": "D", "text": "Immunize with a booster of diphtheria toxoid", "correct": false}], "correct_answer": "C. Nothing is required", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235030593-QTDV027014IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nothing is required The brother in question has been adequately vaccinated. Therefore no post-exposure prophylaxis is required. Diphtheria bacteria usually spread from person to person through respiratory droplets, like from coughing or sneezing. Diphtheria is a serious infection caused by strains of bacteria called Corynebacterium diphtheriae that make a toxin. Adults need 1 booster shot of the Td vaccine every 10 years as part of their routine vaccine schedule. Protection decreases over time, so adults need to get a Td or Tdap booster shot every 10 years to stay protected.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Encrusted cystitis is caused by:", "options": [{"label": "A", "text": "Corynebacterium xerosis", "correct": false}, {"label": "B", "text": "Corynebacterium urealyticum", "correct": true}, {"label": "C", "text": "Corynebacterium renale", "correct": false}, {"label": "D", "text": "Corynebacterium pseudo TB", "correct": false}], "correct_answer": "B. Corynebacterium urealyticum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Corynebacterium urealyticum Encrusted cystitis is a rare condition characterized by an encrustation of the bladder mucosa with associated chronic inflammation induced by urea-splitting bacterial infection--most commonly, Corynebacterium urealyticum . Moreover, it usually occurs in immunocompromised patients, especially recipients of renal transplants or patients with a history of previous urological procedures. There may be bladder calcification seen in it.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Corynebacterium xerosis- cause endocarditis, and skin infections. Option C. Corynebacterium renale- causes pyelonephritis in cattle Option D. Corynebacterium pseudo-TB- causes lymphadenitis in goats and sheep.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Prophylactic drug of choice for diphtheria is?", "options": [{"label": "A", "text": "Tetracycline", "correct": false}, {"label": "B", "text": "Cefaclor", "correct": false}, {"label": "C", "text": "Ceftriaxone", "correct": false}, {"label": "D", "text": "Erythromycin", "correct": true}], "correct_answer": "D. Erythromycin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Erythromycin Penicillin or erythromycin is the drug of choice. Antibiotics play a minor role as it is of no use once the toxin is secreted. However, antibiotics are useful: If given early (< 6 hrs of infection), before the toxin release Prevent further release of toxins by killing the bacilli Treatment for cutaneous diphtheria. Treatment of carriers: The drug of choice is erythromycin</p>\n<p><strong>Highyeild:</strong></p><p>Post-exposure prophylaxis of C. diphtheriae: Identify close contacts; take nose and throat swabs, and arrange clinical surveillance for 7 days. Provide prophylactic antibiotics (single dose of benzylpenicillin or 7 days of erythromycin) and booster vaccination for close contacts.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C . These are not the prophylactic drug of choice in diphtheria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The first bacterium whose genome was sequenced completely is:", "options": [{"label": "A", "text": "E.coli", "correct": false}, {"label": "B", "text": "Bordetella pertussis", "correct": false}, {"label": "C", "text": "Haemophilus influenzae", "correct": true}, {"label": "D", "text": "P. Aeruginosa", "correct": false}], "correct_answer": "C. Haemophilus influenzae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Haemophilus influenzae The first free-living organism to have its genome completely sequenced was the bacterium Haemophilus influenzae, in 1995. The first organism to have its entire genome sequenced was Haemophilus influenzae in 1995. After it, the genomes of other bacteria and some archaea were first sequenced, largely due to their small genome size. H. influenzae has a genome of 1,830,140 base pairs of DNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Genomes of these bacteria were sequenced after H. Influenzae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Rat bite fever is caused by:", "options": [{"label": "A", "text": "Spirillum minus", "correct": false}, {"label": "B", "text": "Streptobacillus moniliformis", "correct": false}, {"label": "C", "text": "Both of the above", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Both of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both of the above Rat-bite fever (RBF) is an infectious disease caused by two different bacteria: Streptobacillus moniliformis is the only reported bacteria that causes RBF in North America (streptobacillary RBF) Spirillum minus is common in Asia. Rat-bite fever is an infection caused by either Streptobacillus moniliformis or Spirillum minus bacteria. Self-explanatory as all options are true</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A child comes to the emergency room because of an infected dog bite. The wound is found to contain small Gram-negative rods. The most likely cause of infection is:", "options": [{"label": "A", "text": "E. coli", "correct": false}, {"label": "B", "text": "H. influenzae", "correct": false}, {"label": "C", "text": "Pasteurella multocida", "correct": true}, {"label": "D", "text": "Brucella canis", "correct": false}], "correct_answer": "C. Pasteurella multocida", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pasteurella multocida Pasteurella multocida is a Gram-negative, non-motile, penicillin-sensitive coccobacillus of the family Pasteurellaceae. Strains of the species are currently classified into five serogroups (A, B, D, E, F) based on capsular composition and 16 somatic serovars. Pasteurella multocida is a common cause of infection following bites or scratches caused by dogs and (especially) cats. Although a variety of organisms have been cultured from infected bites, Pasteurella multocida is the most common.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. coli is spread through contaminated food and beverages. Option B. influenzae is found on the mucous membrane of the upper respiratory tract in humans. It produces no exotoxin. The capsule is anti-phagocytic in the absence of specific anticapsular antibodies. The poly ribose phosphate capsule of type B H influenzae is the major virulence factor. Option D. Brucella canis is a gram-negative bacterium that causes brucellosis in dogs and other canids.</p>\n<p><strong>Extraedge:</strong></p><p>ANIMAL BITE INFECTIONS: PASTEURELLA MULTOCIDA: Usually associated with cat bites. P. multocida is a facultative Gram-negative coccobacillus, which appears pleomorphic in culture and does not grow on MacConkey agar. At 37°C, organisms are capsulated, non-sporing, and non-motile. They show bipolar staining with methylene blue. Most are fermentative, and oxidase- positive, catalase-positive, and indole-positive Capnocytophagia canimorsus: Risk factors— asplenic patients, alcoholics, and those on steroids. Asplenic patients with C. canimorsus infection may present with shock, disseminated purpuric lesions, and DIC. Long, thin, delicate GNRs, are typically fusiform, but older cultures often show pleomorphic sizes and shapes. Facultative anaerobes, and grow best with CO2 enrichment. On blood or chocolate agar, may appear yellowish, with a spreading edge with finger-like projections due to the typical gliding motility. They do not grow on MacConkey agar.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The only species of Shigella that produces Shiga toxin?", "options": [{"label": "A", "text": "Shigella sonnei", "correct": false}, {"label": "B", "text": "Shigella flexneri", "correct": false}, {"label": "C", "text": "Shigella boydii", "correct": false}, {"label": "D", "text": "Shigella dysenteriae", "correct": true}], "correct_answer": "D. Shigella dysenteriae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Shigella dysenteriae SHIGELLA-Non-motile dysenteriae (A), S. flexneri (B), S. boydii (C), S. sonnei (D) Sh sonnei: LLF; more resistant, mildest disease IMViC: - + - -, ANAEROGENIC. Gas producing: Manchester & Newcastle biotypes of S. flexneri type 6 Shigella dysenteriae (Subgroup A) Mannitol nonfermenting bacilli consisting of 10 serotypes. Indole negative. The only member of the Shigella family that is always catalase-negative is type I. Dysentariae types 1 forms a toxin (Shiga toxin), the earliest example of an exotoxin produced by a gram-negative bacillus. Three types of toxic activities were noted: Neurotoxicity Enterotoxicity Cytotoxicity</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B & C. Incorrect as Shigella dysenteries type I is the only Shigella that produces Shiga toxin</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "H. pylori are carcinogenic due to all except:", "options": [{"label": "A", "text": "CagA gene", "correct": false}, {"label": "B", "text": "VacA gene", "correct": false}, {"label": "C", "text": "Elaboration of interleukin", "correct": false}, {"label": "D", "text": "Causes RNA splicing", "correct": true}], "correct_answer": "D. Causes RNA splicing", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Causes RNA splicing Its important virulence factors include urease production, motility, cag gene, and vac gene. The disease-causing strains of Helicobacter pylori contain a “pathogenicity island” containing the CagA (cytotoxin-associated gene A) and a secretory system that injects the CagA protein into the host cells. This is responsible for host cells' morphological changes and expression of proto-oncogenes.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Another gene associated with virulence is Vac A, which encodes a vacuolating toxin that causes apoptosis Infection with H. pylori is associated with gastric adenocarcinomas of the intestine through a sequence that involves chronic gastritis, multifocal atrophy with lower gastric acid secretion, intestinal metaplasia, dysplasia, and carcinoma. Urease production allows it to survive in the acidic environment of the stomach. Option C. Interleukins are associated with inflammation. People with polymorphisms in cytokine genes (e.g. interleukin 1) or genes coding Toll-like receptors are at increased risk of gastric adenocarcinoma. Option D. H pylori does not cause RNA splicing.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A very ill neonate has widespread granulomas. In utero infection with which of the following is suggested by this finding-", "options": [{"label": "A", "text": "Escherichia coli", "correct": false}, {"label": "B", "text": "Haemophilus influenzae", "correct": false}, {"label": "C", "text": "Listeria monocytogenes", "correct": true}, {"label": "D", "text": "Neisseria gonorrhoeae", "correct": false}], "correct_answer": "C. Listeria monocytogenes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Listeria monocytogenes Granulomatous in antiseptic is a condition characterized by multiple skin pustules and visceral granulomas and is due to transplacental spread from the pregnant mother to the fetus. The other options do not cause such an illness.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Escherichia coli (abbreviated as E. coli) are bacteria found in the environment, foods, and intestines of people and animals. E. coli is a large and diverse group of bacteria. Although most strains of E. coli are harmless. Some kinds of E. coli can cause diarrhea, while others cause urinary tract infections, respiratory illness and pneumonia, and other illnesses. Option B. Haemophilus influenzae, a type of bacteria, can cause many different kinds of infections. These infections range from mild, like ear infections, to serious, like bloodstream infections. Option D. Gonorrhea is a sexually transmitted disease (STD) caused by infection with the Neisseria gonorrhoeae bacterium. N. gonorrhoeae infects the mucous membranes of the reproductive tract, including the cervix, uterus, and fallopian tubes in women, and the urethra in women and men. N. gonorrhoeae can also infect the mucous membranes of the mouth, throat, eyes, and rectum.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Persistent fever and neutropenia with persistently negative blood cultures is often caused by which of the following?", "options": [{"label": "A", "text": "Fungi", "correct": true}, {"label": "B", "text": "Gram-negative organisms", "correct": false}, {"label": "C", "text": "Gram-positive organisms", "correct": false}, {"label": "D", "text": "Viral infections", "correct": false}], "correct_answer": "A. Fungi", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Fungi The symptoms of persistent fever and neutropenia (small number of PMNs) reflect a probable infectious disease process. Failure to associate bacteria and/or viruses with an infectious disease process and clinical history might justify the consideration of a fungal etiology. Most fungi reside in nature and are essential in breaking down and recycling organic matter.</p>\n<p><strong>Highyeild:</strong></p><p>The mycoses with the highest incidence— candidiases and dermatophytosis —are caused by fungi that are part of the usual or normal microbial flora of humans. Pathogenic fungi do not produce patent toxins, and the mechanisms of fungal pathogenicity are complex and multifocal, often making these infections hard to treat. The relatively low numbers of fungi in the infection and medium requirements make fungi (choice A) more difficult to isolate, identify, and relate to a medical condition. Gram-positive (choice C) and gram-negative (choice B) bacteria will usually be isolated from clinical specimens. Viral isolation (choice D) is routinely performed successfully today.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B & C - Gram-positive and gram-negative bacteria will usually be isolated from clinical specimens. Option D - Viral isolation is routinely performed successfully today.</p>\n<p><strong>Extraedge:</strong></p><p>The mycoses caused by opportunistic pathogens become increasingly more important. These infections are mainly caused by Candida species, Aspergillus species, Cryptococcus neoformans, Mucor etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 72-year-old was admitted for unremitting, severe, right frontal headache, gait ataxia, and slurred speech for the preceding five days. His past medical history was notable for insulin-dependent diabetes, hypertension, and mitral valve replacement. Their social history was unremarkable; he was a retired shipyard laborer. The patient's wife denied recent travel or pets. The history goes back ten days before presentation when the patient was evaluated at an outside institution for persistent headaches and gait ataxia. At that time, computed tomography of the head was negative for an acute bleed or mass. The patient was presumed to have metabolic encephalopathy and was admitted to the rehabilitation ward for further evaluation of the gait disturbance. He was transferred back to the medical ward for a change in mental status and worsening encephalopathy. Initial vital signs were notable for a maximum temperature of 101.2°F, BP 120/70 mmHg, pulse 78 beats/min., and respiratory rate 20 breaths/min. Physical examination revealed a lethargic man, but who was arousable to verbal and tactile stimuli; he moved all extremities. Their reflexes were intact and he followed simple commands. The remainder of the physical exam was normal. Admission labs were notable for glucose of 225 mg/dL, creatinine of 1.4 mg/dL, ammonia level of 58 umol/L, and WBC count of 14.3 × 103cells/mm3 (81% neutrophils, 10% lymphocytes). Other routine labs were unremarkable. The urinalysis showed moderate bacteriuria and blood with 12-20 WBCs/hpf. microscopy of the blood culture revealed the following findings. Asexual and sexual spores produced by the causative organism are respectively:", "options": [{"label": "A", "text": "Blastospore & Basidiospore", "correct": true}, {"label": "B", "text": "Sporangiospore & Zygospore", "correct": false}, {"label": "C", "text": "Conidiospore & Ascospore", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Blastospore & Basidiospore", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235190108-QTDV028002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Blastospore & Basidiospore The image shows capsulated organisms, suggestive of cryptococcus neoformans. Blastospore & Basidiospore are sexual and asexual asexual and sexual spores respectively, produced by cryptococcus neoformans. yeast-like fungi (Candida species do not produce any sexual spores).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Sporangiospore & Zygospore are asexual and sexual spores respectively, produced by Aseptate molds like (RAM)-RHIZOPUS ABSIDIA & MUCOR. Option C. Conidiospore & Ascospore are sexual and asexual spores respectively, produced by septate & dimorphic fungi.</p>\n<p><strong>Extraedge:</strong></p><p>Dimorphic fungi are organisms that have the ability to switch between two morphologies during their lifecycle: yeast and hyphae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All the following pairs are correct matches regarding the classification of various fungi except?", "options": [{"label": "A", "text": "Yeast-cryptococci", "correct": false}, {"label": "B", "text": "Yeast like -candida", "correct": false}, {"label": "C", "text": "Moulds-aspergillus", "correct": false}, {"label": "D", "text": "Dimorphic fungi-dermatophytes", "correct": true}], "correct_answer": "D. Dimorphic fungi-dermatophytes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dimorphic fungi-dermatophytes → Dimorphic fungi include Histoplasma, Blastomyces, Sporoththrix schenkii, coccidioidomycosis, paracoccidiomycoses & Penicillium marneffei. → Dermatophytes are the fungi that cause fungal infection of skin, nails & hair. → Dermatophytes belong to mold forms.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Yeast-cryptococci (cryptococcus neoformans are the capsulated fungi that are classified as budding yeast producing fungus) Option B. Yeast-like -candida (candida produces pseudo hyphae & is classified as a yeast-like fungus) Option C. Moulds-aspergillus (aspergillus species has septate & acute angled branching hyphae)& are classified as molds)</p>\n<p><strong>Extraedge:</strong></p><p>The most common types of fungi that cause serious or life-threatening infections include: Aspergillus, which causes aspergillosis. It most often affects people with lung disease or a weakened immune system. Candida, which causes candidiasis, also called thrush.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old male presented to a dermatologist with multiple annular lesions with central clearing distributed on the trunk. Patient complaints of itching & burning sensation of the lesions. Dermatologist prepared a KOH mount from the scrapings of the lesion. Which of the following is expected?", "options": [{"label": "A", "text": "KOH mount shows multiple delicate fungal hyphal elements.", "correct": true}, {"label": "B", "text": "KOH mount shows gram-positive cocci in clusters", "correct": false}, {"label": "C", "text": "KOH mount shows infestation with Sarcoptes scabies", "correct": false}, {"label": "D", "text": "KOH mount shows infestation with pediculosis", "correct": false}], "correct_answer": "A. KOH mount shows multiple delicate fungal hyphal elements.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>KOH mount shows multiple delicate fungal hyphal elements. → Multiple annular lesions with central clearing distributed on the trunk, complaining of itching and burning sensation pointing towards the diagnosis of dermatophytosis (tinea infection). dermatophytes belong to mold forms so on KOH mount, fungal hyphae are seen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D . KOH mount is used for fungal hyphae detection but not for bacteria or parasitic infestation.</p>\n<p><strong>Extraedge:</strong></p><p>The KOH (Potassium hydroxide) procedure is a method used to examine specimens for yeast. KOH serves as an enzymatic agent that breaks down debris in a specimen, such as epithelial cells and WBCs, to view yeast or pseudohyphae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the wrong match regarding asexual spores of various fungi produced on SDA (Sabouraud Dextrose Agar ) agar?", "options": [{"label": "A", "text": "Sporangiospores-Rhizopus", "correct": false}, {"label": "B", "text": "Ascospores-histoplasma capsulatum", "correct": true}, {"label": "C", "text": "Arthrospores-trichosporon", "correct": false}, {"label": "D", "text": "Chlamydiospores-candida albicans", "correct": false}], "correct_answer": "B. Ascospores-histoplasma capsulatum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ascospores-histoplasma capsulatum Ascospores are produced by Histoplasma but they are sexual spores, not asexual spores.</p>\n<p><strong>Highyeild:</strong></p><p>Candida albicans is termed a dimorphic fungus because it proliferates in either a yeast form or a hyphal form. The switch between these forms is the result of a complex interplay of external and internal factors and is coordinated in part by polarity-regulating proteins that are conserved among eukaryotic cells.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D - Remaining all other given spores are asexual spores and they are correctly paired.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Opportunistic mycosis is caused by which of the following fungi? Aspergillus Mucor mycosis Cryptococcus Sporothrix schenckii Para coccidiomycosis Select the correct option from the given below code:", "options": [{"label": "A", "text": "i,ii only", "correct": false}, {"label": "B", "text": "i,ii,iii only", "correct": true}, {"label": "C", "text": "i,ii,iii ,iv only", "correct": false}, {"label": "D", "text": "i,ii,iii ,iv & v", "correct": false}], "correct_answer": "B. i,ii,iii only", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>i,ii,iii only Opportunistic mycosis fungal infection that occurs in immunocompromised states.it is caused by opportunistic fungi like candida, cryptococcus, aspergillus, mucor, and pneumocystis.</p>\n<p><strong>Highyeild:</strong></p><p>Common Opportunistic Fungi Candida albicans Cryptococcus neoformans Aspergillus fumigatus Pneumocystis jiroveci Mucor sp. Rhizopus sp. Sporothrix schenkii</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Sporothrix schenkii is a dimorphic fungus, that causes subcutaneous or deep mycosis. Paracoccidiomycosis is also a dimorphic fungus, that causes systemic or endemic mycosis.</p>\n<p><strong>Extraedge:</strong></p><p>Cryptococcus neoformans is a dimorphic fungus that causes lethal meningoencephalitis mainly in immunocompromised individuals. Different morphotypes enable this environmental fungus and opportunistic pathogen to adapt to different natural niches and exhibit different levels of pathogenicity in various hosts.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the causative organism of the following clinical picture & morphology of hyphae. Asexual and sexual spores produced by the causative organism are respectively:", "options": [{"label": "A", "text": "Blastopore & Basidiospore", "correct": false}, {"label": "B", "text": "Sporangiospore & Zygospore", "correct": false}, {"label": "C", "text": "Conidiospore & Ascospore", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Conidiospore & Ascospore", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/questionImage-1694862256470-QTDV028009IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Conidiospore & Ascospore The given image shows flower-like sporulation & subcutaneous lymphatics involved in a continuous fashion (sporotrichosis pattern) suggestive of sporotrichosis which is caused by a dimorphic fungus sporothrix schenkii. Conidiospores & Ascospores are asexual and sexual spores respectively, produced by septate & dimorphic fungi.</p>\n<p><strong>Highyeild:</strong></p><p>Sporothrix schenckii is an ubiquitous dimorphic fungi. Infection is acquired from wound contamination with soil and organic debris from puncture by plant thorns or wood splinters. The mycelial form is inoculated into tissues.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A - Blastopore & Basidiospore are sexual and asexual spores respectively, produced by yeast-like fungi (Candida species do not produce any sexual spores) Option B - sporangiospore & Zygospore are sexual and asexual spores respectively, produced by Aseptate moulds like (RAM)-RHIZOPUS ABSIDA & MUCOR.</p>\n<p><strong>Extraedge:</strong></p><p>Sporothrix schenckii is a worldwide saprophyte of vegetation, notably sphagnum moss. Sporothricosis presents as a chronic infection of skin and the subcutaneous lymphatic system, developing after a primary inoculation such as a rose-thorn puncture. Pulmonary disease from inhalation of spores is uncommon.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following organism is depicted in the KOH mount specimen given below?", "options": [{"label": "A", "text": "Aspergillus", "correct": true}, {"label": "B", "text": "Cryptococcus neoformans", "correct": false}, {"label": "C", "text": "Rhizopus", "correct": false}, {"label": "D", "text": "Mucor mycosis", "correct": false}], "correct_answer": "A. Aspergillus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235195214-QTDV028011IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus The KOH mount picture depicted above is showing septate hyphae with acute angle and dichotomous branches which is a characteristic of aspergillus species</p>\n<p><strong>Highyeild:</strong></p><p>Aspergilloma is a growth (fungus ball) that develops in an area of past lung disease or lung scarring such as tuberculosis or lung abscess. Invasive pulmonary aspergillosis is a serious infection with pneumonia. It can spread to other parts of the body.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B - cryptococcus neoformans is a capsulated fungus associated with meningitis in HIV-positive individuals. Option C - Rhizopus is characterized by producing obtuse-angled & aseptate hyphae. Option D - Mucor mycosis causes invasive fungal infections in immunocompromised patients and is characterized by producing aseptate hyphae which are obtuse angles.</p>\n<p><strong>Extraedge:</strong></p><p>Aspergillosis is a group of illnesses caused by Aspergillus fungi. Some types include allergic bronchopulmonary aspergillosis (ABPA), aspergilloma, chronic pulmonary aspergillosis and invasive aspergillosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the correct option regarding the morphology of various Mucor mycosis fungi?", "options": [{"label": "A", "text": "Rhizopus is characterized by producing nodal rhizoids and aseptate hyphae with obtuse angle branching", "correct": false}, {"label": "B", "text": "Absidia species is characterized by producing internodal rhizoids with aseptate hyphae and obtuse angle branches", "correct": false}, {"label": "C", "text": "Mucor species don't produce any rhizoids and are characterized by producing aseptate hypha with obtuse angle branches", "correct": false}, {"label": "D", "text": "All the above statements are true", "correct": true}], "correct_answer": "D. All the above statements are true", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All the above statements are true Rhizopus is characterized by producing nodal rhizoids and accepted aseptate Hyphae with obtuse angle branching. (option A) Absidia species is characterized by producing internodal rhizoids with accepted aseptate Hyphae and obtuse angle branches. (option B) Mucor species don't produce any rhizoids and are characterized by producing a septate aseptate hypha with an obtuse angle .. (option C)</p>\n<p><strong>Highyeild:</strong></p><p>They are commonly known as black bread mould, pin mould, etc. Some common species of Rhizopus include: Rhizopus stolonifer – It is also known as black bread mould.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Self-explanatory as all options are correct</p>\n<p><strong>Extraedge:</strong></p><p>10 species of Rhizopus have been identified, including the most commonly seen, Rhizopus Stolonifer. The common name of this particular organism, black bread mold, comes from its tendency to grow on bread. The spores of this mold change shape depending on the food source</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following fungus is exclusively seen in Reticulo-endothelial cells?", "options": [{"label": "A", "text": "Cryptococcus", "correct": false}, {"label": "B", "text": "Candida", "correct": false}, {"label": "C", "text": "Aspergillus", "correct": false}, {"label": "D", "text": "Histoplasma", "correct": true}], "correct_answer": "D. Histoplasma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Histoplasma Histoplasmosis is a disease caused by a fungus (or mold) called Histoplasma. It grows in soil and material contaminated with bat or bird droppings. H. capsulatum is a dimorphic fungus, an intracellular organism, which parasitizes the reticuloendothelial system in histoplasmosis involving the spleen, liver, kidney, central nervous system, and other organs.</p>\n<p><strong>Highyeild:</strong></p><p>Histoplasmosis Histoplasma capsulatum Found in Spelunkers, Caves, Bat and Bird droppings Distribution of Histoplasmosis Mississippi and Ohio River Valleys Clinical Most patients remain asymptomatic Disseminated infection more common in immunocompromised Primary infection: Flu-like Chronic infection: TB-like Treatment Antifungal</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A - Cryptococcus neoformans and Cryptococcus gattii are environmental, basidiomycetous yeasts. Infection is initiated by inhalation of the yeast cells, which in nature are dry, minimally encapsulated, and easily aerosolized. In patients who are compromised, the yeasts may multiply and disseminate to other parts of the body but preferentially to the central nervous system, causing cryptococcal meningoencephalitis. Option B - Several species of the yeast genus Candida are capable of causing candidiasis . They are members of the normal flora of the skin, mucous membranes, and gastrointestinal tract. They are not seen exclusively in reticuloendothelial cells. Option C - Aspergillosis is a spectrum of diseases that may be caused by several Aspergillus species. A fumigatus is the most common human pathogen. In the lungs, alveolar macrophages can engulf and destroy the conidia. In the lung, conidia swell and germinate to produce hyphae that tend to invade pre-existing cavities (aspergilloma or fungus ball) or blood vessels.</p>\n<p><strong>Extraedge:</strong></p><p>Histoplasma capsulatum is a species of dimorphic fungus. Its sexual form is called Ajellomyces capsulatus. It can cause pulmonary and disseminated histoplasmosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Deuteromycetes are called imperfect fungi because:", "options": [{"label": "A", "text": "The sexual cycle has not been observed", "correct": true}, {"label": "B", "text": "Nothing about them indicates their relation to other fungi", "correct": false}, {"label": "C", "text": "They do not produce mycelia", "correct": false}, {"label": "D", "text": "They have no asexual reproduction", "correct": false}], "correct_answer": "A. The sexual cycle has not been observed", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The sexual cycle has not been observed Deuteromycetes are an artificial group of fungi, of which there exist approximately fifteen thousand species, often referred to as \"fungi imperfect\" because their only known reproductive mechanism is asexual.</p>\n<p><strong>Highyeild:</strong></p><p>The fungi imperfecti or imperfect fungi, also known as Deuteromycota, are fungi that do not fit into the commonly established taxonomic classifications of fungi that are based on biological species concepts or morphological characteristics of sexual structures because their sexual form of reproduction has never been.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D – All these options are not true about imperfect fungi. Deuteromycota or fungi are imperfect – only their asexual and vegetative phases are known. They form spores by asexual reproduction (sporogenesis).</p>\n<p><strong>Extraedge:</strong></p><p>Dimorphic fungi are fungi that have a yeast (or yeast-like) phase and a mold (filamentous) phase. One of the characteristics common to most dimorphic fungi is the ability to convert the mold forms to the yeast forms by incubating subcultures in enriched media at 35°-37°C.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about fungi:", "options": [{"label": "A", "text": "Eukaryotes", "correct": false}, {"label": "B", "text": "Reproduce by budding", "correct": false}, {"label": "C", "text": "Reproduce by forming spores", "correct": false}, {"label": "D", "text": "All true", "correct": true}], "correct_answer": "D. All true", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All true A fungus is any member of the group of eukaryotic organisms that includes microorganisms such as yeasts and molds, as well as the more familiar mushrooms(option A). These organisms are classified as a kingdom, which is separate from the other eukaryotic life kingdoms of plants and animals.</p>\n<p><strong>Highyeild:</strong></p><p>Fungi reproduce asexually by fragmentation, budding, or producing spores(options B and C). Fragments of hyphae can grow new colonies. Mycelial fragmentation occurs when a fungal mycelium separates into pieces with each component growing into a separate mycelium. Somatic cells in yeast form buds.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Self-explanatory as all options are true</p>\n<p><strong>Extraedge:</strong></p><p>Treatment for Invasive Candidiasis For most adults, the initial recommended antifungal treatment is an echinocandin (caspofungin, micafungin, or anidulafungin) given through the vein (intravenous or IV). Fluconazole, amphotericin B, and other antifungal medications may also be appropriate in certain situations.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following species of candida produces the characteristic thick-walled terminal chlamydospores on corn meal agar?", "options": [{"label": "A", "text": "Candida albicans", "correct": true}, {"label": "B", "text": "Candida tropicalis", "correct": false}, {"label": "C", "text": "Candida krusei", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. Candida albicans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida albicans Candida albicans is an opportunistic pathogenic yeast that is a common member of the human gut flora. It can also survive outside the human body. It is detected in the gastrointestinal tract and mouth in 40-60 percent of healthy adults. Among Candida species, the human fungal pathogen Candida albicans has the special ability to form thick-walled cells, termed chlamydospores, in certain environmental conditions . Chlamydospores arise on elongated suspensor cells situated on pseudo hyphae or hyphae. Chlamydospore is seen in Candida albicans Light inhibits chlamydospore formation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B – There are different media on which C. tropicalis can grow effectively. A common medium used is Sabouraud’s agar which contains peptone and sugar. Option C - Although most of the medically necessary Candida spp. require biotin for growth and some have additional vitamin requirements, only C. krusei can grow in vitamin-free media. However, of the medically necessary Candida spp., C. krusei is perhaps the only species that grows on Sabouraud's dextrose agar as spreading colonies with a matte or a rough whitish-yellow surface, in contrast to the convex colonies of other Candida spp. This characteristic, together with its \"long grain rice\" appearance on microscopy, helps the definitive identification of the species.</p>\n<p><strong>Extraedge:</strong></p><p>Oral thrush is a fungal infection of the mouth. It's not contagious and is usually successfully treated with antifungal medication. It's also called oral candidosis (or candiasis) because it's caused by a group of yeasts called Candida.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true regarding fungi except:", "options": [{"label": "A", "text": "Yeasts are unicellular fungi", "correct": false}, {"label": "B", "text": "Candida forms pseudo mycelium", "correct": false}, {"label": "C", "text": "Dermatophytes are filamentous fungi", "correct": false}, {"label": "D", "text": "Dimorphic fungi behave as molds in cultures at 37°C", "correct": true}], "correct_answer": "D. Dimorphic fungi behave as molds in cultures at 37°C", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dimorphic fungi behave as molds in cultures at 37°C Dermatophytes are the causative agents of dermatophytosis ( tinea ). They are the group of parasitizing filamentous fungi that can infect the keratinized tissues such as the stratum corneum of the epidermis, nails, and hairs</p>\n<p><strong>Highyeild:</strong></p><p>DEFINITION Dimorphic fungi are fungi that can reproduce as either a mycelial or a yeast-l ike state. Generally the mycelial s aprotrophic form grows at 25° C, and the yeast-like pathogenic form at 37° C. This dimorphism is important in the identification of mycoses, as it makes rapid identification of many pathogenic organisms possible. Some diseases caused by dimorphic fungi are: sporotrichosis blastomycosis histoplasmosis coccidioidomycosis paracoccidioidomycosis Penicillosis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A - Yeasts are eukaryotic, single-celled microorganisms classified as members of the fungus kingdom. Option B – Yeasts rarely form truly multicellular structures. Some yeasts form chains of elongated yeast cells, that arise from buds adhering together in branching chains, called pseudomycelia. The individual cells within pseudo mycelia are in independent of one another and unlike the units within the septate hyphae of molds, they are not connected by pores. For example. C.albicans Option C - Dermatophytes are keratinophilic fungi that infect keratinized tissues causing diseases known as dermatophytosis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Dimorphic fungi are all except:", "options": [{"label": "A", "text": "Candida", "correct": true}, {"label": "B", "text": "Blastomyces", "correct": false}, {"label": "C", "text": "Coccidioidomycosis", "correct": false}, {"label": "D", "text": "Histoplasma", "correct": false}], "correct_answer": "A. Candida", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida Candida is a yeast-like fungus. Dimorphic fungi are fungi that can exist in the form of both mold and yeast. This is usually brought about by changes in temperature and the fungi are also described as thermally dimorphic fungi. Several species of dimorphic fungi are important pathogens of humans and other animals, including Coccidioides immitis, Paracoccidioides brasiliensis, Blastomyces dermatitidis, Histoplasma capsulatum, Sporothrix schenckii, Emmonsia sp.</p>\n<p><strong>Highyeild:</strong></p><p>DEFINITION Dimorphic fungi are fungi that can reproduce as either a mycelial or a yeast-l ike state. Generally the mycelial s aprotrophic form grows at 25° C, and the yeast-like pathogenic form at 37° C. This dimorphism is important in the identification of mycoses, as it makes rapid identification of many pathogenic organisms possible. Some diseases caused by dimorphic fungi are: sporotrichosis blastomycosis histoplasmosis coccidioidomycosis paracoccidioidomycosis Penicillosis</p>\n<p><strong>Extraedge:</strong></p><p>Dimorphic fungi are organisms that have the ability to switch between two morphologies during their lifecycle: yeast and hyphae. In thermal-dimorphic fungi, morphologic changes are induced by temperature.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Most common fungal infection in non-HIV (immuno-competent) individuals?", "options": [{"label": "A", "text": "Mucor", "correct": false}, {"label": "B", "text": "Histoplasmosis", "correct": false}, {"label": "C", "text": "Aspergillosis", "correct": false}, {"label": "D", "text": "Candidiasis", "correct": true}], "correct_answer": "D. Candidiasis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candidiasis Candidiasis is a fungal infection caused by a yeast (a type of fungus) called Candida. Some species of Candida can cause infection in people ; the most common is Candida albicans. Candida normally lives on the skin and inside the body, in places such as the mouth, throat, gut, and vagina, without causing any problems. Some species of Candida can cause infection in people.</p>\n<p><strong>Highyeild:</strong></p><p>Dimorphic fungi are organisms that have the ability to switch between two morphologies during their lifecycle: yeast and hyphae. In thermal-dimorphic fungi, morphologic changes are induced by temperature.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and C: cause opportunistic mycoses, more common in immunocompromised individuals. Option B: Histoplasma causes systemic mycoses but the most common fungal infection in non-HIV (immuno-competent) individuals is Candida.</p>\n<p><strong>Extraedge:</strong></p><p>The opportunistic fungal pathogens include Cryptococcus neoformans, Candida spp., Aspergillus spp., Penicillium marneffei, the Zygomycetes, Trichosporon beigelii, and Fusarium spp.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An HIV-positive female has a lesion over the tongue. Microscopy shows budding yeast cells and pseudohyphae and growth in human serum at 37 degrees shows true hyphae. The most probable cause is:", "options": [{"label": "A", "text": "Candida albicans", "correct": true}, {"label": "B", "text": "Histoplasmosis", "correct": false}, {"label": "C", "text": "Blastomycosis", "correct": false}, {"label": "D", "text": "Coccidioidomycosis", "correct": false}], "correct_answer": "A. Candida albicans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Candida albicans Indeed candidiasis is now known to be the most common opportunistic fungal infection in HIV disease. In HIV-positive patients, both colonization and disease in the oral cavity and other mucosal surfaces are common, especially with C. albicans, at rates that increase with the progression of the disease. Mucosal candidiasis, in the form of oral, oesophageal, or vaginal infections, is common in HIV/AIDS. Symptoms include creamy white lesions , loss of taste, and a “cottony feeling” in the mouth. Repeated bouts of oral candidiasis could be the first sign of HIV infection. In people with HIV, oral thrush is more likely to spread to other parts of the body – such as the lungs, liver, and intestines.</p>\n<p><strong>Highyeild:</strong></p><p>ORAL CANDIDIASIS IN HIV</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B – histoplasmosis is cultured in rich media, such as glucose cysteine blood agar at 37 degree Celsius and on SDA or IMA at 25-30 degree Celsius Option C – Blastomycosis culture, colonies develop within 2 weeks on Sabouraud’s enriched blood agar at 30 degree Celsius. The identification is confirmed by conversion to the yeast form after cultivation on a rich medium at 37 degree Celsius by extraction and detection of the B dermatitidis-specific antigen A, or by a specific DNA probe. Option D – Coccidiodmycosis cultures on IMA or brain-heart infusion blood agar slants can be incubated at room temperature or 37 degrees Celsius.</p>\n<p><strong>Extraedge:</strong></p><p>The opportunistic fungal pathogens include Cryptococcus neoformans, Candida spp., Aspergillus spp., Penicillium marneffei, the Zygomycetes, Trichosporon beigelii, and Fusarium spp.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Capsulated fungus is:", "options": [{"label": "A", "text": "Sporothrix", "correct": false}, {"label": "B", "text": "Cryptococcus", "correct": true}, {"label": "C", "text": "Candida", "correct": false}, {"label": "D", "text": "Histoplasmosis", "correct": false}], "correct_answer": "B. Cryptococcus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptococcus Cryptococcus , sometimes informally called crypto, is a genus of fungi, which grow in culture as yeasts. Cryptococcus neoformans is an encapsulated yeast that remains an important pathogen, particularly among patients with the human immunodeficiency virus (HIV). The capsule of Cryptococcus neoformans is its dominant virulence factor and plays a key role in the biology of this fungus. In the environment, the capsule protects the fungus against desiccation and phagocytic predators. Other Options – A, C, and D are not capsulated fungi.</p>\n<p><strong>Highyeild:</strong></p><p>CRYPTOCOCCUS NEOFORMANS</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis of Cryptococcosis Chest x-ray, urine collection, and lumbar puncture are done first. Culture of C. neoformans is definitive. CSF, sputum, and urine yield organisms most often, and blood cultures may be positive, particularly in patients with AIDS.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Eucalyptus camaldulensis is associated with the transmission of:", "options": [{"label": "A", "text": "B. dermatitidis", "correct": false}, {"label": "B", "text": "Histoplasma", "correct": false}, {"label": "C", "text": "Cryptococcus", "correct": true}, {"label": "D", "text": "Coccidioides", "correct": false}], "correct_answer": "C. Cryptococcus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptococcus Eucalyptus camaldulensis is a well-known tree and is highly appreciated by rural and urban dwellers. The role of Eucalyptus trees in the ecology of Cryptococcus neoformans is documented worldwide. Cryptococcus neoformans were recovered from Eucalyptus tree samples. Cryptococcosis is caused by a fungus known as Cryptococcosis neoformans. The infection may be spread to humans through contact with pigeon droppings or unwashed raw fruit . Contact with an infected individual may also spread the infection. Cryptococcus neoformans is a saprophyte isolated from environments contaminated with bird (particularly pigeon) droppings and from the tree Eucalyptus camaldulensis</p>\n<p><strong>Highyeild:</strong></p><p>CRYPTOCOCCUS NEOFORMANS</p>\n<p><strong>Extraedge:</strong></p><p>The principal antifungal agents for the treatment of cryptococcal meningitis are intravenous amphotericin B deoxycholate and its lipid formulations, oral flucytosine, and oral fluconazole.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Environmental source of Cryptococcus neoformans is:", "options": [{"label": "A", "text": "Water", "correct": false}, {"label": "B", "text": "Soil", "correct": false}, {"label": "C", "text": "Pigeon droppings", "correct": true}, {"label": "D", "text": "Meat", "correct": false}], "correct_answer": "C. Pigeon droppings", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pigeon droppings Cryptococcus neoformans is an encapsulated yeast and an obligate aerobe that can live in both plants and animals. It is often found in bird excrement. Pigeon droppings could especially be a potential carrier in the spread of pathogenic yeasts like Cryptococcus neoformans and mold fungi into the environment . The objective of this study was to isolation of Cryptococcus neoformans and other opportunistic fungi from pigeon droppings. Pigeon droppings could especially be a potential carrier in the spread of pathogenic yeasts and mold fungi into the environment. The objective of this study was to isolation of Cryptococcus neoformans and other opportunistic fungi from pigeon droppings.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D – these are not the environmental source of cryptococcus neoformans only pigeon droppings are the environmental source of C. neoformans.</p>\n<p><strong>Extraedge:</strong></p><p>The symptoms of cryptococcal meningitis include: Headache. Fever. Neck pain. Nausea and vomiting. Sensitivity to light. Confusion or changes in behavior.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Endemic mycosis, caused by all except:", "options": [{"label": "A", "text": "Histoplasmosis", "correct": false}, {"label": "B", "text": "Blastomyces", "correct": false}, {"label": "C", "text": "Coccidioidomycosis", "correct": false}, {"label": "D", "text": "Cryptococcosis", "correct": true}], "correct_answer": "D. Cryptococcosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptococcosis Cryptococcosis is a pulmonary or disseminated infection acquired by inhalation of soil contaminated with the encapsulated yeast Cryptococcus neoformans or C. gattii. Symptoms are those of pneumonia , meningitis , or involvement of skin, bones, or viscera. These organisms are found in the soil, and infection occurs following inhalation of the infectious forms of these fungi when sites containing the organism are disturbed. In some endemic areas over one-half of residents have acquired these mycoses early in life.</p>\n<p><strong>Highyeild:</strong></p><p>Cryptococcosis was considered an uncommon infection before the AIDS pandemic; however, it was an awakening mycosis-causing agent. In immunocompromised patients, endemic mycoses can present in atypical form, as well as Candida albicans and Cryptococcus neoformans.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C – These are all endemic mycosis</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis of Cryptococcosis Chest x-ray, urine collection, and lumbar puncture are done first. Culture of C. neoformans is definitive. CSF, sputum, and urine yield organisms most often, and blood cultures may be positive, particularly in patients with AIDS.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Microconidia are absent in-", "options": [{"label": "A", "text": "Trichophyton", "correct": false}, {"label": "B", "text": "Microsporum", "correct": false}, {"label": "C", "text": "Epidermophyton", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Epidermophyton", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Epidermophyton Epidermophyton is a genus of fungus causing superficial and cutaneous mycoses, including E. floccosum, and causes tinea corporis, tinea cruris, tinea pedis, and tinea unguium. Epidermophyton floccosum is a filamentous fungus that causes skin and nail infections in fungal genera; it is distinct from the other two genera Microsporum and Trichophyton for the absence of microconidia.</p>\n<p><strong>Highyeild:</strong></p><p>Epidermophyton floccosum is a filamentous fungus that causes skin and nail infections in humans. This anthropophilic dermatophyte can lead to diseases such as tinea pedis (athlete's foot), tinea cruris, tinea corporis and onychomycosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and B – Microconidia are absent on these options . Conidia are asexual reproductive structures produced either from the transformation of a vegetative yeast or hyphal cell or from a specialized conidiogenous cell, which may be simple or complex and elaborate. Conidia may be formed on specialized hyphae termed conidiophores . Microconidia are small and macroconidia are large or multicellular. Microconidia is seen in Trichophyton, Microsporum, and histoplasmosis.</p>\n<p><strong>Extraedge:</strong></p><p>The three genera of dermatophytes are Trichophyton, Microsporum, and Epidermophyton. Some of these organisms grow only on human hosts (anthropophilic), whereas others can also exist in soil (geophilic) or on animals (zoophilic). All the dermatophytes are keratinophilic (i.e., they feed on keratin).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 24-year-old patient presents with redness, foreign body sensation, and excessive tears in their eyes. On examination, the ophthalmologist is able to appreciate a corneal ulcer in each eye. On detailed history taking, he reveals that he uses contact lenses which he cleans under tap water. The doctor takes a sample of his corneal scraping and sends it for a saline mount microscopy. The microscopy results of the sample reveal polygonal cysts. What could be the most probable cause?", "options": [{"label": "A", "text": "Acanthamoeba", "correct": true}, {"label": "B", "text": "Naegleria", "correct": false}, {"label": "C", "text": "Entamoeba", "correct": false}, {"label": "D", "text": "Giardia", "correct": false}], "correct_answer": "A. Acanthamoeba", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acanthamoeba The given clinical history and demonstration of polygonal cysts are suggestive of Acanthamoeba keratitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Naegleria doesn’t cause keratitis commonly. Option C. Entamoeba causes Gastrointestinal diseases Option D. Giardia causes Gastrointestinal diseases mainly</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The image depicted below is the life cycle of:", "options": [{"label": "A", "text": "Taenia solium", "correct": true}, {"label": "B", "text": "Taenia saginata", "correct": false}, {"label": "C", "text": "Hymenolepis Nana", "correct": false}, {"label": "D", "text": "Echinococcus granulosus", "correct": false}], "correct_answer": "A. Taenia solium", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235291004-QTDV029002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Taenia solium The definitive host is a man and the intermediate host is pig for taenia solium. Larva can infect man and can cause intestinal taeniasis and the eggs infect pig or man & can cause cysticercosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. taenia saginata (beef tapeworm) has cattle as the intermediate host and man as the definitive host and the infected form is Lava which causes cysticercosis bovis. Option C. Hymenolepis Nana or dwarf tapeworm do not have any intermediate host. Option D. Definitive hosts for E. granulosus are wild and domestic canids Intermediate hosts for E. granulosus depend on genotype, for zoonotic genotypes are usually ungulates, including sheep and goats. Other intermediate hosts can be camels, castles, etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The image depicted below is life cycle of:", "options": [{"label": "A", "text": "Diphyllobothrium latum", "correct": true}, {"label": "B", "text": "Taenia solium", "correct": false}, {"label": "C", "text": "Hymenolepis Nana", "correct": false}, {"label": "D", "text": "Echinococcus granulosus", "correct": false}], "correct_answer": "A. Diphyllobothrium latum", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235294251-QTDV029003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diphyllobothrium latum Diphyllobothrium latum is a fish tapeworm, which has two intermediate hosts which include cyclops and fish. Plerocercoid Larva is an infective form. It is an inhabitant of the small intestine and can cause megaloblastic anemia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. The definitive host is a man and the intermediate host is a pig for taenia solium. Larva can infect man and can cause intestinal taeniasis and the eggs infect pig or man & can cause cysticercosis. Option C. Hymenolepis Nana or dwarf tapeworm do not have any intermediate. Option D. echinococcus granulosus or dog tapeworm is a small intestine inhabitant & can cause hydatid disease in humans.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following are correct regarding the locomotive organs of various intestinal protozoa? Balantidium coli-pseudopodia Entamoeba Histolytica-Cilia Giardia Lamblia-Flagella Cryptosporidium-No locomotory organs Select the correct options from the given below code:", "options": [{"label": "A", "text": "1 and 2", "correct": false}, {"label": "B", "text": "1, 2 and 3", "correct": false}, {"label": "C", "text": "3 and 4", "correct": true}, {"label": "D", "text": "1, 2, 3 and 4", "correct": false}], "correct_answer": "C. 3 and 4", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>3 and 4 The following are the locomotive organs of different intestinal protozoa Balantidium Coli- Cilia Entamoeba Histolytica- pseudopodia Trichomonas vaginalis Giardia lamblia - Flagella Cryptosporidium, Cyclospora & Isospora- No locomotory organs</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The egg of which of the following parasites consists of polar filaments arising from either end of the embryophore:", "options": [{"label": "A", "text": "Taenia saginata", "correct": false}, {"label": "B", "text": "Taenia solium", "correct": false}, {"label": "C", "text": "Echinococcus granulosus", "correct": false}, {"label": "D", "text": "Hymenolepis nana", "correct": true}], "correct_answer": "D. Hymenolepis nana", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis nana Hymenolepis nana and H. diminuta infections are most often asymptomatic. Heavy infections with H. nana can cause weakness, headaches, anorexia, and abdominal pain. Hymenolepiasis is the most common intestinal tapeworm infection of humans caused by worm of the family Cestoda, genus Hymenolepis and species Nana. This infection does not require an intermediate host and infection can occur directly from one infected person to another by fecal-oral transmission.</p>\n<p><strong>Highyeild:</strong></p><p>Eggs of Hymenolepis nana: These eggs are oval and smaller than those of H. diminuta, with a size range of 30 to 50 µm. On the inner membrane are two poles, from which 4-8 polar filaments spread out between the two membranes. Dwarf tapeworm is a cosmopolitan species though most common in temperate zones, and is one of the most common cestodes infecting humans, especially children.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and B. Eggs have radially striated inner embryophore. Option C. Eggs contain Hexacanth embryos with 3 pairs of hooks, known as oncosphere.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Man is an intermediate host in all except:", "options": [{"label": "A", "text": "Malaria", "correct": false}, {"label": "B", "text": "Echinococcus granulosus", "correct": false}, {"label": "C", "text": "Echinococcus multilocularis", "correct": false}, {"label": "D", "text": "Hymenolepis nana", "correct": true}], "correct_answer": "D. Hymenolepis nana", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis nana Hymenolepis nana is the smallest of all tapeworms found in humans and is appropriately described as the dwarf tapeworm. It is the only cestode that does not require an intermediate host to develop into its infective stage. A common intermediate host, however, is the grain beetle. Hymenolepiasis is the most common intestinal tapeworm infection of humans caused by worms of the family Cestoda, genus Hymenolepis and species Nana. This infection does not require an intermediate host and infection can occur directly from one infected person to another by fecal-oral transmission.</p>\n<p><strong>Highyeild:</strong></p><p>Infobits Parasites having direct life cycle Protozoa ● Giardia lamblia ● Trichomonas vaginalis ● Balantidium coli Helminths ● Ascaris lumbricoides ● Trichuris trichiura ● Ancyclostoma duodenale Parasites having indirect life cycle S.No Protozoa Definite host Intermediate host 1. Plasmodium spp Female Anopheles mosquito Man 2. Toxoplasma gondii Cat Man 3. Cestodes Taenia solium Man Pig 4. Trematodes Fasciola hepatica Man Snail 5. Nematodes Wuchereria bancrofti Man Mosquito</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Intermediate host of malaria is the mosquito (female anopheles) Option B. Definitive hosts for E. granulose are wild and domestic canids I ntermediate hosts for E. granulose depend on genotype, the zoonotic genotype is usually ungulates, including sheep and goats. Other intermediate hosts can be camels, cattle, etc. Option C. multilocularis – Definitive host – fox, whereas dogs and cats act as sources of human infection. Intermediate host – rodents and humans</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following cestodes can complete their life cycle in one host?", "options": [{"label": "A", "text": "Taenia saginata", "correct": false}, {"label": "B", "text": "Taenia solium", "correct": false}, {"label": "C", "text": "Echinococcus granulosus", "correct": false}, {"label": "D", "text": "Hymenolepis nana", "correct": true}], "correct_answer": "D. Hymenolepis nana", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis nana Hymenolepis nana life cycle. Eggs of Hymenolepis nana are immediately infective when passed with the stool and cannot survive more than 10 days. Hymenolepis nana is the smallest of all tapeworms found in humans and is appropriately described as the dwarf tapeworm. It is the only cestode that does not require an intermediate host to develop into its infective stage. A common intermediate host, however, is the grain beetle. Hymenolepis diminuta is a cestode of rodents infrequently seen in humans and frequently found in rodents. The life cycle of Hymenolepis nana. Eggs of Hymenolepis nana are immediately infective when passed with the stool.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. T . saginata has two hosts: definitive host – humans and intermediate host- cattle hence it is also called beef tapeworm disease. Option B. T solium also has two hosts: definitive host – humans and intermedi ate hosts – pigs Option C. E. granulosus also has two hosts: definitive hosts – domestic and wild canids and intermediate hosts – sheep and goats .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Among the following cestodes, adult worms are found in the human intestine in all except:", "options": [{"label": "A", "text": "Taenia saginata", "correct": false}, {"label": "B", "text": "Diphyllobothrium latum", "correct": false}, {"label": "C", "text": "E. granulosus", "correct": true}, {"label": "D", "text": "H nana", "correct": false}], "correct_answer": "C. E. granulosus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>E. granulosus The definitive host is dogs- adult worms are present. The intermediate host man-larval stage is seen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Adult worms are found in the human intestine. Taenia saginata is the intestinal tapeworms for which humans are the only definitive hosts. An estimated 80 million people are colonized with beef or pork tapeworm. Option A. Humans become infected by ingesting raw or undercooked infected meat containing cysticerci. Option B. Diphyllobothrium is a genus of tapeworms that can cause diphyllobothriasis in humans. Adult worms are seen in the human intestine. The adults attach to the intestinal mucosa by means of the two bilateral grooves (bothria) of their scolex. Option D. H nana- smallest cestode infecting humans . Adult worms are seen in the human intestine. Nana and humans can become infected with the latter by direct ingestion of eggs. Within the arthropod host, the eggs develop into cysticercoids, which can infect the mammalian host upon ingestion and develop into adults in the small intestine. Nana and humans can become infected with the latter by direct ingestion of eggs. Within the arthropod host, the eggs develop into cysticercoids, which can infect the mammalian host upon ingestion and develop into adults in the small intestine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Man is an intermediate host for:", "options": [{"label": "A", "text": "Brugia malayi", "correct": false}, {"label": "B", "text": "W. Bancrofti", "correct": false}, {"label": "C", "text": "Fish Tapeworm", "correct": false}, {"label": "D", "text": "Echinococcus", "correct": true}], "correct_answer": "D. Echinococcus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Echinococcus Echinococcus, also called the hydatid worm , or dog tapeworm, is a cyclophyllidean cestode that dwells in the small intestine of canines as an adult but has important intermediate hosts such as livestock and humans, where it causes cystic echinococcosis, also known as hydatid disease. The definitive host of this parasite is dogs and the intermediate host is most commonly sheep, however, cattle, horses, pigs, goats, and camels are also potential intermediate hosts. Humans can also be an intermediate host for Echinococcus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Mosquito of various species is the intermediate host in brugia malayi Option B. Mosquitos are intermediate hosts in W. Bancroft Option C. Intermediate host is vertebrates in the case of Taenia and Mesocestoides and insects in the case of Dipylidium and Hymnolepis.</p>\n<p><strong>Extraedge:</strong></p><p>Parasites for which man is the intermediate host SPEET spiromertra sp Plasmodium sp Echinococcus granulosus Echinococcus multilocularis Taenia multiceps Infobits Parasites having direct life cycle Protozoa ● Giardia lamblia ● Trichomonas vaginalis ● Balantidium coli Helminths ● Ascaris lumbricoides ● Trichuris trichiura ● Ancyclostoma duodenale Parasites having indirect life cycle S.No Protozoa Definite host Intermediate host 1. Plasmodium spp Female Anopheles mosquito Man 2. Toxoplasma gondii Cat Man 3. Cestodes Taenia solium Man Pig 4. Trematodes Fasciola hepatica Man Snail 5. Nematodes Wuchereria bancrofti Man Mosquito</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following does not possess rostellum-", "options": [{"label": "A", "text": "Taenia solium", "correct": false}, {"label": "B", "text": "Taenia saginata", "correct": true}, {"label": "C", "text": "Hymenolepis nana", "correct": false}, {"label": "D", "text": "Taenia multiceps", "correct": false}], "correct_answer": "B. Taenia saginata", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Taenia saginata Also known as unarmed tapeworm. Taenia saginata, commonly known as the beef tapeworm, is a zoonotic tapeworm belonging to the order Cyclophyllidea and genus Taenia. It is an intestinal parasite in humans causing taeniasis and cysticercosis in cattle. T he scolex has four suckers, but they have no hooks . The lack of hooks and a rostellum is an identifying feature of other Taenia species. The rest of the body proper, the strobila, is basically a chain of numerous body segments called proglottids.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. The rostellum is an organ of attachment of tapeworms, in addition to the surrounding suckers, to the intestinal wall of the host. It is protruded during attachment, and by the use of hooks penetrates the intestinal mucosa.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following protozoa may be detected by Fecal Acid Fast Stain, except?", "options": [{"label": "A", "text": "Cryptosporidium", "correct": false}, {"label": "B", "text": "Isospora", "correct": false}, {"label": "C", "text": "Cyclospora", "correct": false}, {"label": "D", "text": "Microsporidia", "correct": true}], "correct_answer": "D. Microsporidia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Microsporidia Microsporidia are a group of spore-forming unicellular parasites. They were once considered protozoans or protists, but are now known to be fungi or a sister group to fungi. Loosely 1500 of the probably more than one million species are named. Modified Acid-Fast Staining Procedure. This technique is useful for the identification of oocysts of the coccidian species Cryptosporidium, Cystoisospora, and corpora. Evaluation of different modifications of acid-fast staining techniques and stool enzyme-linked immunosorbent assay in detecting fecal samples.</p>\n<p><strong>Highyeild:</strong></p><p>Cryptosporidium parvum Cyclospora spp 10 μη Isospora belli Cryptosporidium measures 5 to 6 μm in diameter and is ovoid to spherical. Cyclospora species appear as non-refractile, spherical to oval, and slightly wrinkled bodies, measuring 8 to 10 μm in diameter. This is almost twice the size of the oocysts of Cryptosporidium species and an important differentiating feature. Cystoisospora-They measure 25 to 30 μm in diameter , have a thin, smooth wall, and are nonmotile in the fresh stool. Immature oocytes contain a single sporocyst.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. All these protozoa can be detected by fecal acid-fast stain</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The transmission of the parasite is by ingestion of the embryonated egg with contaminated food and water in.?", "options": [{"label": "A", "text": "Ascaris lumbricoides", "correct": false}, {"label": "B", "text": "Strongyloides stercoralis", "correct": false}, {"label": "C", "text": "Trichuris trichiura", "correct": false}, {"label": "D", "text": "A & C", "correct": true}], "correct_answer": "D. A & C", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A & C A scaris lumbricoides is the \"large roundworm\" of humans, growing to a length of up to 35 cm. Fertilized and unfertilized Ascaris lumbricoides eggs are passed in the stool of the infected host. Fertilized eggs are rounded and have a thick shell with an external mammilla layer that is often stained brown by bile. In some cases, the outer layer is absent, known as decorticated eggs. Trichuris trichiura eggs are 50-55 micrometers by 20-25 micrometers. They are barrel-shaped, thick-shelled, and possess a pair of polar \"plugs\" at each end. The eggs are unembryonated when passed in the stool.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Strongyloides stercoralis is classified as a soil-transmitted helminth, it means that the primary mode of transmission is through contact with soil that is contaminated with free-living larvae</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the organism given below which Produces Ground itch in man?", "options": [{"label": "A", "text": "Ascaris lumbricoides", "correct": false}, {"label": "B", "text": "Necator americanus", "correct": true}, {"label": "C", "text": "Schistosoma mansoni", "correct": false}, {"label": "D", "text": "Trichuris trichiura", "correct": false}], "correct_answer": "B. Necator americanus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235295761-QTDV029014IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Necator americanus Necator americanus is a species of hookworm commonly known as the New World hookworm. Like other hookworms, it is a member of the phylum Nematoda. It is an obligatory parasitic nematode that lives in the small intestine of human hosts. Clinical manifestations of hookworm infection include an urticarial dermal reaction \"ground itch\" associated with filariform (L3) larvae penetration , and respiratory involvement including eosinophilic pneumonia may be observed, and may occur during larval pulmonary migration, A second urticarial rash may subsequently.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The organism shown in the picture below transmits which of the following disease -", "options": [{"label": "A", "text": "Japanese encephalitis", "correct": false}, {"label": "B", "text": "Sleeping sickness", "correct": false}, {"label": "C", "text": "Kala-azar", "correct": true}, {"label": "D", "text": "Filaria", "correct": false}], "correct_answer": "C. Kala-azar", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235297137-QTDV029015IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Kala-azar The above-given image depicts a Sandfly which is a vector for Leishmania donovani which causes Kala-azar. Kala-azar, also called visceral leishmaniasis, i s a disease in which a parasite migrates to the internal organs such as the liver, spleen, hence \"visceral\", and bone marrow. Visceral leishmaniasis, also known as kala-azar, is characterized by irregular bouts of fever, substantial weight loss, swelling of the spleen and liver, and anemia. Kala-azar: A chronic and potentially fatal parasitic disease of the viscera (the internal organs, particularly the liver, spleen, bone marrow, and lymph nodes) due to infection by the parasite called Leishmania donovani. Kala-azar is a slow-progressing indigenous disease caused by a protozoan parasite of the genus Leishmania</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Japanese encephalitis is caused by the Japanese encephalitis virus which is spread by mosquitoes, specifically Culex. Pigs and birds serve as a reservoir for the virus. Option B. Sleeping sickness also known as African trypanosomiasis is caused by parasites of the species Trypanosoma brucei. It is transmitted by the tsetse fly. Option D. F ilariasis commonly known as elephantiasis caused when filarial parasites are transmitted to humans by</p>\n<p><strong>Extraedge:</strong></p><p>TSE FLY</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Phylum Apicomplexa contains:", "options": [{"label": "A", "text": "Malarial parasite", "correct": true}, {"label": "B", "text": "Ciliates", "correct": false}, {"label": "C", "text": "Pseudopods", "correct": false}, {"label": "D", "text": "Amoebae", "correct": false}], "correct_answer": "A. Malarial parasite", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Malarial parasite The Apicomplexa (also called Apicomplexia) are a large phylum of parasitic alveolates. Most of them possess a unique form of organelle that comprises a type of plastid called an apicoplast, and an apical complex structure. The organelle is an adaptation that the apicomplexan applies in the penetration of a host cell. They are mostly obligate intracellular parasites. The Apicomplexa are a phylum of diverse obligate intracellular parasites including Plasmodium spp., the cause of malaria; Toxoplasma gondii and Cryptosporidium parvum, are opportunistic pathogens of immunocompromised individuals.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Ciliates belong to the Ciliophora phylum Option C. Pseudopods: They are projections of the cytoplasm of unicellular protists or eukaryotic cell membrane Option D. Amoeba belongs to the amoeba phylum</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Erythrocytic schizogony of Plasmodium liberates:", "options": [{"label": "A", "text": "Sporozoites", "correct": false}, {"label": "B", "text": "Trophozoites", "correct": false}, {"label": "C", "text": "Merozoites", "correct": true}, {"label": "D", "text": "Phanerozoites", "correct": false}], "correct_answer": "C. Merozoites", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Merozoites Erythrocytic schizogony refers to the asexual reproduction of a parasite in e rythrocytes (red blood cells). Schizogony refers to a replicative process in which the parasite undergoes multiple rounds of nuclear division without cytoplasmic division followed by budding, or segmentation, to form progeny. Erythrocytic schizogony consists of 3-5 rounds (depending on species) of nuclear replication followed by a budding process. Late-stage schizonts in which the individual merozoites become discernible are called segmenters. The host erythrocyte ruptures and releases the merozoites. Upon release, the merozoites invade the red blood cells where they undergo another asexual cycle called erythrocytic schizogony. This is also known as the erythrocytic cycle</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B and D. Erythrocytic schizogony of plasmodium doesn’t liberate sporozoites, trophozoites, or phanerozoites.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 26 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A pharmaceutical researcher is trying to develop a vaccine against the hepatitis C virus. She infects a chimpanzee with the hepatitis C virus of known genotype and subtype. A liver sample is obtained several weeks later, and viral RNAs are extracted from the hepatocytes. A genetic study of the viral genomes reveals that the extracted RNA sequences vary significantly from that of the original infecting virus. This genetic instability is most likely due to the lack of which of the following features during the viral replication process?", "options": [{"label": "A", "text": "3'-->5' exonuclease activity", "correct": true}, {"label": "B", "text": "5'-->3' exonuclease activity", "correct": false}, {"label": "C", "text": "Glycosylase activity", "correct": false}, {"label": "D", "text": "Ligase activity", "correct": false}], "correct_answer": "A. 3'-->5' exonuclease activity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>3'-->5' exonuclease activity Hepatitis C virus (HCV) has > 6 genotypes and multiple sub-genotypes. These variant strains differ primarily at hypervariable genomic regions, such as those in the sequences encoding its two envelope glycoproteins. Moreover, there is no proofreading 3'-->5' exonuclease activity built into the virion-encoded RNA polymerase . As a result, the RNA polymerase makes many errors during replication, and several dozen subspecies of HCV are typically present in the blood of an infected individual at any one time.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. 5'-->3' exonuclease activity allows DNA polymerase I to engage in nick translation, which is essential for both DNA repair and the removal of RNA primers during replication. This feature is not the cause of instability in HCV. Option C. DNA glycosylase is important in base excision repair as it removes the nitrogen base from the sugar-phosphate backbone. An endonuclease then completes the remainder of the repair. This enzyme is not the cause of instability in HCV. Option D. DNA ligase is used to join 2 fragments of DNA and is therefore necessary for both DNA repair and replication. The HCV genome is a single-stranded, positive-sense RNA molecule that does not require ligase activity during replication.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 65-year-old man comes to the office clinic after his wife insisted he get a checkup. The patient feels well and has no chronic medical conditions but has not seen a physician in many years. He received blood transfusions after a motor vehicle trauma in his 20s. The patient does not use tobacco or illicit drugs but drinks 2 or 3 alcoholic beverages daily. Physical examination reveals no hepatomegaly, ascites, or dilation of the superficial abdominal veins. The remainder of the examination shows no abnormalities. Serology is positive for hepatitis C antibodies. Chronic hepatitis C infection is confirmed with positive HCV RNA testing. After appropriate counseling is provided, combination therapy with sofosbuvir and ledipasvir is planned. This treatment is most likely to help clear the infection through which of the following mechanisms?", "options": [{"label": "A", "text": "Blocking reverse transcription of viral RNA", "correct": false}, {"label": "B", "text": "Enhancing antiviral host immune response", "correct": false}, {"label": "C", "text": "Impairing viral entry into host cells", "correct": false}, {"label": "D", "text": "Inhibiting viral genome replication and assembly", "correct": true}], "correct_answer": "D. Inhibiting viral genome replication and assembly", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inhibiting viral genome replication and assembly Hepatitis C virus (HCV) is a blood-borne pathogen that is primarily transmitted via injection drug use or transfusion of blood products (prior to widespread screening in 1992). Chronic infection develops in most individuals and increases the risk for cirrhosis and hepatocellular carcinoma. Because chronic HCV infection is often asymptomatic for decades, patients are often unaware that they have contracted the virus. Therefore, HCV testing is recommended for high-risk patients (eg, remote history of blood transfusion). Treatment of chronic HCV infection is with direct-acting antiviral (DAA) agents , which target specific enzymes in the HCV life cycle to inhibit viral replication and assembly, as follows: RNA-dependent RNA polymerase inhibitors - HCV binds to and enters host cells, uncoats, and subsequently replicates its genome using HCV-encoded RNA-dependent RNA polymerase. Nucleotide/non-nucleoside RNA polymerase inhibitors such as sofosbuvir target this step. Protease inhibitors - HCV mRNA is translated by host ribosomes into a polyprotein, which is cleaved by HCV protease into the individual proteins that compose the virus. HCV protease inhibitors such as simeprevir target this step. NS5A inhibitors - The HCV protein NS5A is crucial for viral replication and assembly (through unclear mechanisms) and is targeted by HCV medications such as ledipasvir. DAA treatment results in a sustained virologic response (complete elimination of virus) in >97% of treated individuals.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. HCV does not contain a reverse transcriptase enzyme so it does not integrate its genome into the host cell. Therefore, there are no reverse transcriptase inhibitors for HCV. Reverse transcriptase inhibitors are a mainstay of therapy for HIV. Option B. Interferon-gamma was previously used in the treatment of chronic HCV (in combination with ribavirin) to trigger a broad antiviral immune response. However, interferon therapy has a lower cure rate (50%-80%) and a much higher incidence of side effects (eg, flu-like symptoms). Therefore, DAAs are now used preferentiall Option C. HIV fusion inhibitors (eg, enfuvirtide} and CCR5 inhibitors (eg, maraviroc) inhibit the ability of HIV to enter cells. DAAs do not target viral entries.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old woman comes to the office clinic with recent onset of malaise. The patient reports feeling \" under the weather\" but otherwise has no symptoms. She is an avid cyclist and is concerned about her ability to participate in a charity race in 3 days. The patient works as a nurse at a local hospital and lives at home with her husband and 2-year-old son. She occasionally smokes when she goes out, but since she began feeling ill, she no longer has the desire to smoke. Physical examination is notable for hepatomegaly. Laboratory results are as follows: Anti-HAV lgM =positive Anti-HAV lgG =negative HBsAg =negative HBeAg =negative Anti-HBs =positive Anti-HBc =negative Anti-HBe =negative Anti-HCV =negative Which of the following is most likely to be elicited on further history taking?", "options": [{"label": "A", "text": "Had a tattoo recently at a local tattoo parlor", "correct": false}, {"label": "B", "text": "Had an accidental needlestick exposure at work", "correct": false}, {"label": "C", "text": "Hard boiled eggs from the hospital cafeteria", "correct": false}, {"label": "D", "text": "Had food at a neighborhood restaurant", "correct": true}], "correct_answer": "D. Had food at a neighborhood restaurant", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Had food at a neighborhood restaurant THE TEST RESULTS DEPICTS Hepatitis A infection, which is commonly transmitted by food. AntiHBs positive is usually due to prior vaccination.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis A infection is caused by an RNA picornavirus with an average incubation period of 30 days. Transmission occurs through the fecal-oral route and is common in areas with overcrowding and poor sanitation. Outbreaks frequently result from contaminated water or food, with raw or steamed shellfish, Onset is acute, and symptoms can include malaise, fatigue, anorexia, nausea, vomiting, mild abdominal pain, and an aversion to smoking (for unclear reasons). Hepatomegaly is commonly seen. Serum aminotransferases spike early in the illness, followed by increases in bilirubin and alkaline phosphatase. Anti-HAV lgM is positive and is a marker of active disease. Hepatitis A infection is a self-limiting disease and does not progress to chronic hepatitis, cirrhosis, or hepatocellular carcinoma. Treatment is largely supportive, with complete recovery expected in 3-6 weeks. People considered at high risk (eg, those living in or traveling to endemic areas, those with chronic liver disease or clotting factor disorders, men who have sex with men) should be given the hepatitis A vaccine as prophylaxis. Unvaccinated close contacts of individuals with hepatitis A should receive the vaccine or immune globulin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A and B. Unsanitary tattooing (eg, with contaminated needles), accidental needlesticks, and unprotected sexual intercourse are important risk factors for hepatitis B and C. This patient is positive for HBsAb, which confirms that she has antibodies to hepatitis B surface antigen and, given the negative anti-HBc, suggests that she has been vaccinated and is now immune. Option C. The consumption of boiled eggs is not commonly associated with hepatitis A infection. If the boiled eggs were insufficiently cooked, Salmonella infection would be a risk.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A sexually active 17-year-old man presents to the local free clinic to check some small papules that appeared on his penis. The papules are small and white and contain a central depression in their center. There is no penile discharge, nor is there pain on urination. To what group is the organism most likely associated with?", "options": [{"label": "A", "text": "Poxviridae", "correct": true}, {"label": "B", "text": "Papovaviridae", "correct": false}, {"label": "C", "text": "Adenoviridae", "correct": false}, {"label": "D", "text": "Parvoviridae", "correct": false}], "correct_answer": "A. Poxviridae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Poxviridae Poxviridae is a family of viruses. Humans, vertebrates, and arthropods serve as natural hosts. There are currently 83 species in this family, divided among 22 genera, which are divided into two subfamilies. Diseases associated with this family include smallpox. The family Poxviridae is a large and diverse family of double-stranded DNA viruses with ubiquitous distribution. Poxviruses are among the larger viruses known. They are very easy to isolate and can be grown in a variety of cell cultures.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Papovavirus belongs to the family papillomaviridae that infects birds and mammals. It manifests as warts on skin, benign tumors and sometimes malignant tumors also. Option C. The signs and symptoms are not associated with adenovirus. Option D. Papules are not seen in parvovirus infection. Clinical manifestations are – erythema infectiosum (fifth disease), Transient aplastic crisis, B19 infection in immunodeficient patients, B19 infection during pregnancy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Negative strand RNA viruses use ……………….. during genome replication:", "options": [{"label": "A", "text": "Reverse transcriptase", "correct": false}, {"label": "B", "text": "RNA-dependent RNA polymerase", "correct": true}, {"label": "C", "text": "Thymidine kinase", "correct": false}, {"label": "D", "text": "Neuraminidase", "correct": false}], "correct_answer": "B. RNA-dependent RNA polymerase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>RNA-dependent RNA polymerase Negative-strand RNA virus: Also known as an antisense-strand RNA virus, a virus whose genetic information consists of a single strand of RNA that is the negative or antisense strand which does not encode mRNA (messenger RNA). RNA-dependent RNA polymerase (RdRP, RDR) or RNA replicase is an enzyme that catalyzes the replication of RNA from an RNA template. Specifically, it catalyzes synthesis of the RNA strand complementary.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Reverse transcriptase converts RNA sequences to cDNA sequences that are capable of inserting into different areas of the genome Option C. Thymidine kinase have been identified in Herpes simplex virus, varicella zoster virus and Epstein-barr virus. It reacts with the ATP to give thymidine monophosphate and ADP. Option D. The neuraminidase has a major role in the release of nascent vial particles assembled in infected cells. It facilitates the release of viral particles from cells by the cleavage of a sialic acid residue of glycan moiety linked to cellular glycoproteins in the plasma membrane.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "What type of symmetry has poliovirus?", "options": [{"label": "A", "text": "Icosahedral", "correct": true}, {"label": "B", "text": "Helical", "correct": false}, {"label": "C", "text": "Complex", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. Icosahedral", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Icosahedral Poliovirus, the causative agent of polio, is a serotype of the species Enterovirus C, in the family of Picornaviridae. Poliovirus is composed of an RNA genome and a protein capsid. The genome is a single-stranded positive-sense RNA genome. Poliovirus is composed of an RNA genome and a protein capsid. The genome is a single-stranded positive-sense RNA genome that is about 7500 nucleotides long. The viral particle is about 30 nm in diameter with complex symmetry. For nonenveloped viruses, the viral particle must provide the machinery necessary for either the entire virion, a nucleoprotein complex.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option C – Complex symmetry symmetry is found in human papillomavirus, rhinovirus, hepatitis B virus and herpes viruses. Option B – Helical symmetry – Ebola and tobacco mosaic virus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a Hazard group 4 agent?", "options": [{"label": "A", "text": "Ebola", "correct": false}, {"label": "B", "text": "Marburg", "correct": false}, {"label": "C", "text": "Variola", "correct": false}, {"label": "D", "text": "Vaccinia", "correct": true}], "correct_answer": "D. Vaccinia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vaccinia Vaccinia virus is a large, complex, enveloped virus belonging to the poxvirus family. It has a linear, double-stranded DNA genome approximately 190 kbp in length, which encodes approximately 250 genes. Vaccinia: The cowpox virus which is used to vaccinate against smallpox. A cutaneous or systemic reaction to vaccination occurs with the smallpox vaccine as, for example, in congenital vaccinia and progressive vaccinia. Vaccinia virus infection is typically very mild and often does not cause symptoms in healthy individuals, although it may cause rash and fever. Immune responses generated from a vaccinia virus infection protects the person against a lethal smallpox infection.</p>\n<p><strong>Highyeild:</strong></p><p>Classification of Infectious Microorganisms by Risk Group Risk Group Classification NIH Guidelines for Research involving Recombinant DNA Molecules 2002 2 World Health Organization Laboratory Biosafety Manual 3rd Edition 2004 Risk Group 1 Agents not associated with disease in healthy adult humans. (No or low individual and community risk) A microorganism unlikely to cause human or animal disease. Risk Group 2 Agents associated with human disease that is rarely serious and for which preventive or therapeutic interventions are often available. (Moderate individual risk; low community risk) A pathogen that can cause human or animal disease but is unlikely to be a serious hazard to laboratory workers, the community, livestock or the environment. Laboratory exposures may cause serious infection, but effective treatment and preventive measures are available and the risk of spread of infection is limited. Risk Group 3 Agents associated with serious or lethal human disease for which preventive or therapeutic interventions may be available (high individual risk but low community risk). (High individual risk; low community risk) A pathogen that usually causes serious human or animal disease but does not ordinarily spread from one infected individual to another. Effective treatment and preventive measures are available. Risk Group 4 Agents likely to cause serious or lethal human disease for which preventive or therapeutic interventions are not usually available (high individual risk and high community risk) (High individual and community risk) A pathogen that usually causes serious human or animal disease and can be readily transmitted from one individual to another, directly or indirectly. Effective treatment and preventive measures are not usually available.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B and C. All these options are Hazard group 4 agents Risk Group 1 (RG1) - Agents that are not associated with disease in healthy adult humans. This group includes a list of animal viral etiologic agents in common use. These agents represent no or little risk to an individual and no or little risk to the community. Risk Group 2 (RG2) - Agents that are associated with human disease which is rarely serious and for which preventive or therapeutic interventions are often available . These agents represent a moderate risk to an individual but a low risk to the community. Risk Group 3 (RG3) - Agents that are associated with s erious or fatal human disease for which preventive or therapeutic interventions may be available. These agents represent a high risk to an individual but a low risk to the community. Risk Group 4 (RG4) - Agents that are likely to cause serious or fatal human disease for which preventive or therapeutic interventions are not usually available. These agents represent a high risk to the individual and a high risk to the community.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "“N95” face masks designed to help provide respiratory protection for the wearer. Name implies:", "options": [{"label": "A", "text": "Not resistant to oil & 95% filter efficiency", "correct": true}, {"label": "B", "text": "Not resistant to water & 95% filter efficiency", "correct": false}, {"label": "C", "text": "Not resistant to viruses & 95% filter efficiency", "correct": false}, {"label": "D", "text": "Not resistant to bacteria & 95% filter efficiency", "correct": false}], "correct_answer": "A. Not resistant to oil & 95% filter efficiency", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Not resistant to oil & 95% filter efficiency An N95 respirator is a respiratory protective device designed to achieve a very close facial fit and very efficient filtration of airborne particles. An N95 respirator is a respiratory protective device designed to achieve a very close facial fit and very efficient filtration of airborne particles. Surgical N95 Respirators are commonly used in healthcare settings and are a subset of N95 Filtering Facepiece Respirators (FFRs), often referred to as N95s. N95 – Filters at least 95% of airborne particles. And is Not resistant to oil. Therefore, the filtration efficiencies of the tested N95 respirators can be regarded as 95% efficient</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C and D – Features Benefits Drawbacks N95 Respirators - Tight fitting (filtration rate >95%) To be used by healthcare workers Greater protection against aerosols and droplets Requires regular fit-testing and seal check Diminishing supplies Higher cost than surgical masks Surgical Masks Loose fitting, provides physical barrier -To be used by healthcare workers - Cheaper, more easily available - Can be layered over N95 masks Air leakage (cannot be used during aerosol-generating procedures) - Disposable, meant for one- time use Cloth Masks - Loose fitting, usually made of polyester or cotton Can be layered with filter paper For use by general public - Can be homemade, washed and reused Use can prevent hoarding of medical masks Insufficient protection from aerosols Powered Air-Purifying Respirators (PAPRs) Loose head-top with battery powered blower to filter air For use during aerosol- generating procedures - Greater protection compared to N95 Does not require fit-testing, can be worn with facial hair More comfortable Expensive, limited availability High cost and difficulty of maintenance</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "How do herpes viruses produce their messenger RNA:", "options": [{"label": "A", "text": "By producing a positive sense intermediate", "correct": false}, {"label": "B", "text": "By direct translation from genome", "correct": false}, {"label": "C", "text": "By transcription of proviral DNA", "correct": false}, {"label": "D", "text": "By transcribing from the genomic DNA", "correct": true}], "correct_answer": "D. By transcribing from the genomic DNA", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>By transcribing from the genomic DNA HSV-1 is a DNA virus . During lytic infections, the herpes simplex virus (HSV) virion host shutoff (Vhs) endoribonuclease degrades many host and viral mRNAs. Within infected cells it cuts mRNAs at preferred sites, including some in regions of translation initiation. Herpes simplex viruses (HSVs) contain a function that can cause the degradation of host mRNA. Herpesviruses are large DNA viruses that replicate in the nucleus and express their genes by exploiting host cell mRNA biogenesis mechanisms including transcription, nuclear export, translation and turnover.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: -</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 18-year-old female presents to her physician with a 1 week history of fever, sore throat, fatigue, and myalgia. Physical examination reveals enlarged tonsils and exudative pharyngitis. Based on her clinical presentation, her physician diagnoses her with infectious mononucleosis. Because there are multiple causes of infectious mononucleosis-like illnesses, which of the following diagnostic assays would rule out CMV as the causative agent of this patient's infection?", "options": [{"label": "A", "text": "A negative Gram stain of a throat swab", "correct": false}, {"label": "B", "text": "A lack of atypical lymphocytes in the patient's blood", "correct": false}, {"label": "C", "text": "A positive histological finding of cytomegaly", "correct": false}, {"label": "D", "text": "A positive Monospot test", "correct": true}], "correct_answer": "D. A positive Monospot test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A positive Monospot test Cytomegalovirus infection is a common herpesvirus infection with a wide range of symptoms: from no symptoms to fever and fatigue (resembling infectious mononucleosis) to severe symptoms involving the eyes, brain, or other internal organs. This virus is spread through sexual and nonsexual contact with body secretions. CMV infection, serum sickness, or another viral illness rarely causes a false-positive heterophile antibody test (monospot test). The best diagnostic test for establishing CMV mononucleosis is serology for CMV IgM antibodies, which should be positive in the majority of patients during the symptomatic phase of the illness. A positive test means heterophile antibodies are present. These are most often a sign of mononucleosis . Although a positive heterophile antibody is widely accepted as a diagnosis of acute mononucleosis due to EBV infection, physicians should keep in mind that the results can still be falsely positive in many conditions including CMV infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B and C. Are not useful to rule out CMV infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which specimen is best for detection of cytomegalovirus?", "options": [{"label": "A", "text": "Blood", "correct": true}, {"label": "B", "text": "Cerebrospinal fluid", "correct": false}, {"label": "C", "text": "Cervical tissue", "correct": false}, {"label": "D", "text": "Skin", "correct": false}], "correct_answer": "A. Blood", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Blood The CMV test determines the presence of antibodies to a virus called cytomegalovirus (CMV) in the blood. The presence of CMV IgM cannot be used by itself to diagnose primary CMV infection because IgM can also be present during secondary CMV infection. IgM positive results in combination with low IgG avidity results are considered reliable evidence for primary infection. PCR testing of peripheral blood has been widely used as a standard diagnostic method to detect invasive CMV infections in immunocompromised individuals including allograft recipients and patients with AIDS .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The first recognised outbreak of Chikungunya disease occurred in 1952 in:", "options": [{"label": "A", "text": "Tanzania", "correct": true}, {"label": "B", "text": "Malaysia", "correct": false}, {"label": "C", "text": "India", "correct": false}, {"label": "D", "text": "Mauritius", "correct": false}], "correct_answer": "A. Tanzania", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tanzania Chikungunya was first identified in Tanzania in the early 1952 and has caused periodic outbreaks in Asia and Africa since the 1960s. Outbreaks are often separated by periods of more than 10 years. Between 2001 and 2011, a number of countries reported chikungunya outbreaks. The disease was first detected in 1952 in Africa following an outbreak on the Makonde Plateau. This is a border area between Mozambique and Tanzania. The virus was isolated from the serum of a febrile patient from this place. Chikungunya was first identified in Tanzania in the early 1952 and has caused periodic outbreaks in Asia and Africa since the 1960s.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Arboviruses are transmitted by blood sucking arthropods from one vertebrate host to the other. Arboviruses are found in the following virus families except:", "options": [{"label": "A", "text": "Togaviridae", "correct": false}, {"label": "B", "text": "Flaviviridae", "correct": false}, {"label": "C", "text": "Bunyaviridae", "correct": false}, {"label": "D", "text": "Arenaviridae", "correct": true}], "correct_answer": "D. Arenaviridae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Arenaviridae The Arenaviridae are a family of viruses whose members are generally associated with rodent-transmitted diseases in humans. Each virus usually is associated with a particular rodent host species in which it is maintained. Others : The term arbovirus (arthropod-borne virus) includes several families of viruses that are spread by arthropod vectors, most commonly mosquitoes, ticks, and sand flies. Option A, B and C. The families of viruses included in the arbovirus group are Flaviviridae, Togaviridae, Bunyaviridae, and Reoviridae. Arbovirus is an informal name used to refer to any viruses that are transmitted by arthropod The Arenaviridae are a family of viruses whose members are generally associated with rodent-transmitted diseases in humans. Each virus usually is associated with a particular rodent host species in which it is maintained.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B and C. The term arbovirus (arthropod-borne virus) includes several families of viruses that are spread by arthropod vectors, most commonly mosquitoes, ticks, and sand flies. The families of viruses included in the arbovirus group are Flaviviridae, Togaviridae, Bunyaviridae, and Reoviridae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the vector for Zika virus?", "options": [{"label": "A", "text": "Aedes Aegypti", "correct": true}, {"label": "B", "text": "Culex tritaneorrhyncus", "correct": false}, {"label": "C", "text": "Phlebotomous papatasii", "correct": false}, {"label": "D", "text": "Anopheles", "correct": false}], "correct_answer": "A. Aedes Aegypti", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aedes Aegypti Zika virus is an emerging mosquito- borne virus with Zika virus transmission and/or Aedes mosquito vectors. Zika virus is transmitted to humans primarily through the bite of an infected Aedes species. The mosquito vectors typically breed in domestic water-holding containers; they are aggressive daytime biters and feed both indoors and outdoors near dwellings. Zika virus is a member of the virus family Flaviviridae. It is spread by daytime-active Aedes mosquitoes, such as A. aegypti and A. albopictus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Culex Tritaeniorhynchus is the main vector of Japanese encephalitis Option C. Phlebotomus Papatasi is the vector of Leishmania major causing cutaneous leishmaniasis. Option D. Anopheles mosquito is a vector of malaria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a live vaccine?", "options": [{"label": "A", "text": "Oral polio vaccine", "correct": false}, {"label": "B", "text": "MMR (Measles, Mumps and Rubella) vaccine", "correct": false}, {"label": "C", "text": "Yellow fever vaccine", "correct": false}, {"label": "D", "text": "Hepatitis B vaccine", "correct": true}], "correct_answer": "D. Hepatitis B vaccine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hepatitis B vaccine The hepatitis B vaccine is given to prevent the severe liver disease that can develop when children or adults are infected with hepatitis B virus. You cannot get hepatitis B from the vaccine – there is no human blood or live virus in the vaccine. Under National immunization schedule: It is given at 6, 10, 14 weeks (along with DPT vaccine). Additional dose at birth may be given in areas with prevalence of HBV > 8% Minimum interval between the doses- 4 weeks. Booster doses are needed after 5 years especially to high-risk groups if the antibody titer falls below 10 mIU/ml.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Oral polio vaccine is used to eradicate polio. It is a live vaccine Option B. MMR – mumps, measles and rubella – it is also a live vaccine Option C. Yellow fever vaccine is also a live vaccine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Reverse transcriptase is a RNA dependent DNA polymerase. Which of these use it?", "options": [{"label": "A", "text": "Hepatitis A virus", "correct": false}, {"label": "B", "text": "Hepatitis B virus", "correct": true}, {"label": "C", "text": "Hepatitis E virus", "correct": false}, {"label": "D", "text": "Hepatitis C virus", "correct": false}], "correct_answer": "B. Hepatitis B virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hepatitis B virus HBV is replicated by a virally encoded polymerase (HP), a specialized reverse transcriptase (RT). HP uses the viral pregenomic RNA (pgRNA) as the template to synthesize minus-strand viral DNA via its RNA-dependent DNA polymerization activity HBV replication cycle. Hepatitis B virus (HBV) infections rely on the proper functioning of the viral polymerase enzyme, a specialized reverse transcriptase (RT) with multiple activities. In particular, the HBV RT has the unique ability to initiate viral DNA synthesis using itself as a protein primer in a novel protein priming reaction. A reverse transcriptase (RT) is an enzyme used to generate complementary DNA (cDNA) from an RNA template, a process termed reverse transcription.</p>\n<p><strong>Highyeild:</strong></p><p>PROPERTY HEPATITIS HEPATITIS B HEPATITIS C HEPATITIS D HEPATITIS E Common name Infectious Serum Posttransfusion non-A, non-B Delta Enteric non-A, non-B Virus structure (family) Naked, RNA (picornavirus Envelope, DNA (hepadnavirus) Envelope, RNA (flavivirus) Envelope, RNA Naked, RNA (calici-like) Transmission Fecal-oral Parenteral, sexual Parenteral, sexual Parenteral, sexual Fecal-oral Incubation period Short Long Long Intermediate Short Usual onset* Abrupt Insidious Insidious Abrupt Abrupt Severity Mild or asymptomatic Occasionally severe Usually subclinical Occasionally to often severe Mild, but severe in pregnant women Mortality rate* Very low Low Low High to very high Low but high in pregnant women Chronicity (carrier state) No Yes Yes (common) Yes No Other disease associations None HCC, cirrhosis HCC, cirrhosis Cirrhosis, fulminant hepatitis None</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, C and D. All hepatitis viruses except Hepatitis B virus have a single stranded RNA or ssRNA genome. They do not replicate by reverse transcription.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following are true about bacteriophage, except:", "options": [{"label": "A", "text": "It is a virus which infects bacteria", "correct": false}, {"label": "B", "text": "It helps in transduction", "correct": false}, {"label": "C", "text": "It imparts toxigenicity to bacteria", "correct": false}, {"label": "D", "text": "It transfers only chromosomal genes", "correct": true}], "correct_answer": "D. It transfers only chromosomal genes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It transfers only chromosomal genes Chromosomal or plasmid DNA can be transferred. Viruses which infect bacteria are called bacteriophages. They play an important role in the transmission of genetic information between bacteria by the process of transduction . Transfer of genetic material by bacteriophages is called transduction . Chromosomal/plasmid DNA can be transferred. The presence of the phage genome integrated with the bacterial chromosome confers on the bacteria certain properties by a process called phage conversion or Lysogenic conversion. They can carry antibiotics resistance genes or virulence genes. Bacteria can be typed by phage typing methods for epidemiological purposes. Lysogenic phages confer toxigenicity to bacteria, eg. C.diphtheriae, E.coli, V.cholerae, Cl.botulinum, etc.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A & C. The presence of the phage genome integrated with the bacterial chromosome confers on the bacteria certain properties by a process called phage conversion or Lysogenic conversion Option B. They play an important role in the transmission of genetic information between bacteria by the process of transduction.</p>\n<p><strong>Extraedge:</strong></p><p>STRUCTURE OF BACTERIOPHAGE</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Plaque assay is done for:", "options": [{"label": "A", "text": "Isolation and typing of viruses", "correct": false}, {"label": "B", "text": "Measuring the number of infectious virus particles", "correct": true}, {"label": "C", "text": "Determining the size of virus", "correct": false}, {"label": "D", "text": "Accessing multiplication of virus", "correct": false}], "correct_answer": "B. Measuring the number of infectious virus particles", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Measuring the number of infectious virus particles Two types of infectivity assays can be carried out – Quantitative and Quantal. Quantal assays only indicate the presence of or absence of infectious viruses. It is an end-point biologic assay . It depends on the measurement of animal death, animal infection, or cytopathic effects in tissue culture at a series of dilutions of the virus being tested.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Quantitative assays measure the actual number of infectious particles in the inoculums. P laque assay is a quantitative assay of virus infectivity which is carried out on a monolayer cell culture. Serial dilutions of virus are inoculated. Each infectious viral particle gives rise to a localized focus of infected cells known as plaques. Another method of quantitative assays is pock assay carried out on a chick embryo chorio – allantoic membrane.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Virus quantification is done by:", "options": [{"label": "A", "text": "Egg inoculation", "correct": false}, {"label": "B", "text": "Hemadsorption", "correct": false}, {"label": "C", "text": "Plaque assay", "correct": true}, {"label": "D", "text": "Electron microscopy", "correct": false}], "correct_answer": "C. Plaque assay", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Plaque assay This is the most widely used assay for infectious virus particles. Two types of infectivity assays can be carried out – Quantitative and Quantal. Quantitative assays– measures the actual number of infectious particles in the inoculums. Plaque assa y– is a quantitative assay of virus infectivity which is carried out on a monolayer cell culture. Serial dilutions of viruses are inoculated. Each infectious viral particle gives rise to a localized focus of infected cells known as plaques. Another method of quantitative assays is pock assay carried out on a chick embryo chorio – allantoic membrane. Quantal assays only indicate the presence of or absence of infectious viruses. It is an end-point biologic assay. It depends on the measurement of animal death, animal infection, or cytopathic effects in tissue culture at a series of dilutions of the virus being tested</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Egg inoculation is used for isolation of viruses Option B. The phenomenon of hemadsorption is dependent on selective attachment of erythrocytes onto the monolayer surface of tissue culture cells. Option D. Electron microscopy is used for obtaining high resolution images of biological and non-biological specimens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following viral disease does not occur in India:", "options": [{"label": "A", "text": "KFD Kyasanur forest disease", "correct": false}, {"label": "B", "text": "Dengue", "correct": false}, {"label": "C", "text": "Lassa fever", "correct": true}, {"label": "D", "text": "Japanese encephalitis", "correct": false}], "correct_answer": "C. Lassa fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lassa fever L assa fever causes hemorrhagic feve r, and is found in Africa . It is caused by the Lassa fever virus which belongs to Arenaviruses has a segmented, negative stranded RNA genome. They are r odent borne viruses. Other examples of Arenaviruses are LCMV Lymphocytic choriomeningitis virus and South American hemorrhagic fever viruses, like Sabia V, Machupo V, etc</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Kyasanur Forest disease (KFD) is a hemorrhagic fever found in Karnataka state (India). It was named the KFD virus after the place where the first isolations were made. An outbreak of KFD has been reported in 2015 from Wayanad and Malappuram districts of Kerala. Option B. Dengue was initially confined to the east coast of India and has caused epidemics (some- times along with the chikungunya virus). Subsequently, it spread westwards and, in the 1990s, Surat and Delhi had major epidemics with deaths due to DHF dengue hemorrhagic fever and Acute dextran sulfate sodium DSS. All four types of dengue virus are present in this country. Option D. Japanese encephalitis virus occurs from East Asia to South Asia, from Korea and Japan in the north to India and Malaysia in the south.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Segmented genome virus:", "options": [{"label": "A", "text": "Influenza", "correct": true}, {"label": "B", "text": "Polio", "correct": false}, {"label": "C", "text": "HTLV-III", "correct": false}, {"label": "D", "text": "Adenovirus", "correct": false}], "correct_answer": "A. Influenza", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Influenza Orthomyxovirus (influenza virus), Reovirus (eg. Rota), Arenavirus (eg. Lassa fever) and Bunyavirus have segmented genomes.</p>\n<p><strong>Highyeild:</strong></p><p>A Arena viridae dsRNA R Reoviridae dsRNA B Bunyaviridae SSRNA O Orthomyxoviridae SSRNA In Influenza the single-stranded RNA genome is segmented into eight pieces, each piece representing a gene. Genetic reassortment of the various genes of influenza A is a common natural event.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Antigenic drift is seen in:", "options": [{"label": "A", "text": "Adenovirus", "correct": false}, {"label": "B", "text": "Influenza", "correct": true}, {"label": "C", "text": "Chickenpox", "correct": false}, {"label": "D", "text": "Dengue", "correct": false}], "correct_answer": "B. Influenza", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Influenza Antigenic variability is highest in influenza virus type A and less in type B, while it has not been demonstrated in type C. The internal RNP (Ribonucleoproteins) antigen and M protein antigen are stable but both surface antigens undergo independent antigenic variations , which may be of two types: Antigenic shift and drift. Antigenic shift results from gene reassortments . Antigenic drift results from accumulations of point mutations occurring sequentially.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, C and D. Antigenic drift is not seen in these options ANTIGENIC DRIFT VERSUS ANTIGENIC SHIFT ANTIGENIC DRIFT ANTIGENIC SHIFT A mechanism for variation by viruses, which involves the accumulation of mutations within the antigen-binding sites A sudden shift in the antigenicity of a virus resulting from the combination of the genomes of two viral strains The variation in the antigenic pool is by the accumulation of gene mutations Two different strains of viruses combine to form a new subtype A minor antigenic change A major antigenic change Results in a new viral strain Results in a new subtype of the virus Occurs frequently Occurs once in a time The new viral strain may infect the hosts of the same species The new viral subtype may infect another host in a different species Easy to treat Difficult to treat Occurs in Influenza virus A, B, and C Occurs in Influenza virus A Gives rise to epidemics between pandemics Gives rise to pandemics Visit www.PEDIAA.com</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 22-year-old man with fever and joint pain is found to have atypical lymphocytes on his blood smear. The further evaluation shows that his condition is caused by an enveloped virus containing partially double-stranded circular DNA. An enzyme packed in its virion has RNA-dependent DNA polymerase activity. This patient is most likely infected with which of the following viruses?", "options": [{"label": "A", "text": "Coxsackie virus", "correct": false}, {"label": "B", "text": "Cytomegalovirus", "correct": false}, {"label": "C", "text": "Epstein-Barr virus", "correct": false}, {"label": "D", "text": "Hepatitis B virus", "correct": true}], "correct_answer": "D. Hepatitis B virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hepatitis B virus This patient's fever and joint pain are nonspecific symptoms of a viral infection. Atypical (reactive) lymphocytes are also nonspecific and are seen with many viral infections (although Epstein-Barr and cytomegalovirus are usually present with the highest counts). Based on the described viral morphology, this patient is most likely infected with the hepatitis B virus (HBV), a member of the DNA-containing Hepadnaviridae family. The mature virion (a Dane particle) consists of a hexagonal protein core (capsid) covered with a lipid bilayer envelope studded with proteins and carbohydrates. The HBV genome is a partially double-stranded circular DNA molecule housed within the capsid. After the virion enters the cell, the capsid is released into the cytoplasm, and the viral genome is transferred into the nucleus. The viral DNA is then repaired to form a fully double-stranded circular minichromosome that can be transcribed into viral mRNAs. The genome replicates within a newly synthesized capsid containing the full-length viral mRNA transcript. Reverse transcriptase (which has both RNA and DNA-dependent DNA-polymerase activity) acts on this RNA template to create a single-stranded DNA intermediate that is converted back into circular, partially double-stranded DNA. The mature capsid is then enveloped by a portion of the endoplasmic reticulum containing virally-encoded proteins to form the completed virion.</p>\n<p><strong>Highyeild:</strong></p><p>The complete hepatitis B virion is called the Dane particle . It is a DNA virus of the Hepadna family and consists of an outer envelope and core. The core is formed in the hepatocyte nucleus. It contains partially double-stranded circular DNA - the DNA polymerase repairs a single-stranded gap.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Coxsackie virus is within the Picornaviridae family and comprises an icosahedral nucleocapsid and a + single-stranded RNA genome. The RNA has a protein on the 5' end that acts as a primer for transcription by RNA-dependent RNA polymerase. Option B & C. Cytomegalovirus and Epstein-Barr virus are members of the Herpesviridae family. All viruses within this family contain an icosahedral core surrounded by a lipoprotein envelope and have double-stranded, linear DNA. These are the only viruses to acquire their envelopes by budding from the nuclear membrane.</p>\n<p><strong>Extraedge:</strong></p><p>Differences between bacterial & viral meningitis Viral Bacterial Common microbes ● Enteroviruses, ● Arboviruses, ● Herpes Simplex virus type 2 ● Adults: Streptococcus pneumonia & Neisseria meningitidis ● Neonates: Group B Streptococcus & & gram- negative bacilli CSF cell differential ● WBC count often <500 cells/mm3 ● Lymphocytic predominance ● WBC count often >1000 cells/mm3 ● Neutrophilic predominance CSF glucose & protein ● Glucose levels are normal or slightly reduced ● Protein generally <150 mg/dl ● Glucose levels <45 mg/dl ● Protein is often >250 mg/dl CSF Gram stain & culture ● No organisms identified ● Often positive for a specific organism</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old pregnant woman is found to have chronic viral hepatitis B on liver biopsy. The presence of which of the following serologic markers is most likely to increase the risk of vertical transmission of the virus?", "options": [{"label": "A", "text": "HBcAg", "correct": false}, {"label": "B", "text": "HBsAg", "correct": false}, {"label": "C", "text": "HBeAg", "correct": true}, {"label": "D", "text": "Anti- HBcAg IgG", "correct": false}], "correct_answer": "C. HBeAg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HBeAg Vertical transmission of hepatitis B from pregnant females to the unborn child can occur with active hepatitis B infection. Such transmission typically occurs during the fetus's passage through the birth canal, but transplacental infection can also occur. This is especially common in those women who develop acute hepatitis B infection in the third trimester. The presence of HBeAg (a soluble protein marker of viral replication and increased infectivity) in the mother significantly increases the risk of vertical transmission of the virus. Were this woman HBeAg negative, her neonate's risk of infection would be 20%? However, if she were HBeAg positive, her neonate's disease risk would be 95%. Moreover, if the infant becomes infected, his chance of progressing to chronic hepatitis is 90%. Because of this concern, the newborns of all mothers with active hepatitis B are passively immunized at birth with hepatitis B immune globulin (HBIG), followed by active immunization with recombinant HBV vaccine.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. HBcAg is not detectable in serum as it is usually sequestrated within the HBsAg coat. Option: B. HBsAg is the first virological marker detected in the serum after inoculation, preceding the elevation of serum aminotransferases and the onset of clinical symptoms. It remains detectable during the entire symptomatic phase of acute hepatitis B and suggests infectivity. It is not the most ominous marker in the pregnant woman, however. Option: D. Anti-HBc appears in the serum shortly after the emergence of HBsAg and remains detectable long after the patient recovers. The IgM fraction signals the acute phase of the disease, whereas the IgG fraction signals recovery from the illness. Because IgM anti-HBc is present in the \"window period,\" it is an essential tool for diagnosis when HBsAg has been cleared and anti-HBs are not yet detectable. Thus, IgM anti-HBc is the most specific marker for diagnosing acute hepatitis B.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The Image shows the transmission cycle of which of the following arboviruses?", "options": [{"label": "A", "text": "JEV Japanese encephalitis virus", "correct": false}, {"label": "B", "text": "WNV", "correct": true}, {"label": "C", "text": "YF Yellow Fever virus", "correct": false}, {"label": "D", "text": "KFD Kyasanur Forest disease virus", "correct": false}], "correct_answer": "B. WNV", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689235841692-QTDV032003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>WNV When a mosquito bites an infected bird, the virus enters the mosquito's bloodstream and eventually moves into its salivary glands. When an infected mosquito bites an animal or a human (host), the virus is passed into the host's bloodstream, where it may cause serious illness. West Nile virus is a single-stranded RNA virus that causes West Nile fever. It is a member of the family Flaviviridae, specifically from the genus Flavivirus, which also contains the Zika virus, dengue virus, and yellow fever virus. West Nile virus is primarily transmitted by mosquitoes, mostly species of Culex. Arbovirus is an informal name used to refer to any viruses that are transmitted by arthropod vectors. The word arbovirus is an acronym (arthropod-borne virus). Viruses transmitted by an arthropod vector can cause CNS infections, undifferentiated febrile illness, acute polyarthropathy, and hemorrhagic fevers. West Nile virus (WNV) is the leading cause of domestically acquired arboviral disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Japanese encephalitis (JE) flavivirus is closely related to West Nile and St. Louis encephalitis viruses. The JE virus is transmitted to humans through the bite of infected Culex species mosquitoes, particularly Culex tritaeniorhynchus. The virus is maintained in a cycle between mosquitoes and vertebrate hosts, primarily pigs and wading birds. Humans are incidental or dead-end hosts because they usually do not develop high enough concentrations of JE virus in their bloodstreams to infect feeding mosquitoes. JE virus transmission occurs primarily in rural agricultural areas, often associated with rice production and flooding irrigation. In some regions of Asia, these conditions can occur near urban centers. Option C.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Torres bodies are inclusion bodies seen in:", "options": [{"label": "A", "text": "Herpes virus", "correct": false}, {"label": "B", "text": "Enterovirus Fowl pox", "correct": false}, {"label": "C", "text": "Yellow fever virus", "correct": true}, {"label": "D", "text": "Vaccinia virus", "correct": false}], "correct_answer": "C. Yellow fever virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Yellow fever virus Torres bodies -Amorphous eosinophilic nuclear inclusions associated with yellow fever , a disease caused by the arbovirus. Yellow fever virus encephalomyelitis of adult albino mice, the occurrence of intranuclear inclusions within nerve cells, particularly within spinal and bulbar motoneurons, is a constant finding. Others: Inclusion bodies, sometimes called elementary bodies, are nuclear or cytoplasmic aggregates of stable substances, usually proteins. They typically represent sites of viral multiplication in a bacterium or a eukaryotic cell and usually consist of viral capsid proteins.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Herpes virus- intranuclear inclusions seen called Lipschvitz bodies ( Type A inclusion bodies). Option B. Fowl pox - intracytoplasmic inclusions seen called Bollinger bodies. Option D. Vaccinia virus- intracytoplasmic inclusions seen called Guarnieri bodies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which one of the following arbovirus diseases has not been reported in India?", "options": [{"label": "A", "text": "Japanese Encephalitis", "correct": false}, {"label": "B", "text": "Yellow fever", "correct": true}, {"label": "C", "text": "Chikungunya fever", "correct": false}, {"label": "D", "text": "Kyasanur Forest Disease", "correct": false}], "correct_answer": "B. Yellow fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Yellow fever The yellow fever virus is found in tropical and subtropical areas of Africa and South America. Although India provides a conducive environment for yellow fever, due to strict pre-travel vaccination norms, India is still YF Free. The virus is spread to people by the bite of an infected mosquito. Yellow fever is an infrequent cause of illness in U.S. travelers.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. JEV in India was obtained through the studies conducted in 1952. A major outbreak occurred in the Bankura district of West Bengal in 1973. Since then, the virus has been found active almost in every part of India, and attacks have been reported regularly. Option C. Chikungunya was reported in India in 1963 and re-emerged in 2005, ever since it's endemic in India. Option D. Kyasanur forest disease (KFD) or monkey fever is a unique public health problem along the belts of the Western Ghats of India. The disease is caused by the KFD virus (KFDV), an arbovirus family, Flaviviridae. Kyasanur forest disease (KFD) is a tick-borne viral hemorrhagic fever endemic to Southwestern India.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 37-year-old develops a fever, chills, headache, and backache. Four days later, he develops a high fever and jaundice. Yellow fever is diagnosed. Which of the following statements about yellow fever is correct?", "options": [{"label": "A", "text": "Anopheles mosquitoes transmit the virus in the urban form of the disease", "correct": false}, {"label": "B", "text": "Monkeys in the jungle are a significant reservoir", "correct": true}, {"label": "C", "text": "3 doses of vaccines are given for protection at a gap of 4 weeks.", "correct": false}, {"label": "D", "text": "All infections lead to symptomatic", "correct": false}], "correct_answer": "B. Monkeys in the jungle are a significant reservoir", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Monkeys in the jungle are a significant reservoir Yellow fever occurs in urban and rural areas of Africa and central South America. In jungle and forest areas, monkeys are the main reservoir of infection. THE WILD MONKEY IS A RESERVOIR FOR THE VIRUS OF YELLOW FEVER. The jungle (sylvatic) cycle involves the virus transmission between non-human primates (e.g., monkeys) and mosquito species found in the forest canopy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Yellow fever is an acute viral hemorrhagic disease transmitted by infected Aedes mosquitoes. The \"yellow\" in the name refers to the jaundice that affects som e patients. Option C. Yellow fever is prevented by a highly effective vaccine that is safe and affordable. A single yellow fever vaccine is sufficient to grant sustained immunity and life-long protection against yellow fever disease. A booster dose of the vaccine is not needed. The vaccine provides effective immunity (for ten years) within ten days for 80-100% of people vaccinated and within 30 days for more than 99%. Option, D. Yellow fever virus, incubates in the body for 3 to 6 days. Many people do not experience symptoms, but when these occur, the most common are fever, muscle pain with prominent backache, headache, loss of appetite, and nausea or vomiting. In most cases, symptoms disappear after 3 to 4 days.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "According to International Health Regulation, yellow fever transmission risk is minimal if Aedes aegypti is less than?", "options": [{"label": "A", "text": "0.10%", "correct": true}, {"label": "B", "text": "0.05%", "correct": false}, {"label": "C", "text": "0.08%", "correct": false}, {"label": "D", "text": "1%", "correct": false}], "correct_answer": "A. 0.10%", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>0.10% Yellow fever virus is transmitted to people primarily through the bite of infected Aedes or Haemagogus species mosquitoes. Mosquitoes acquire the virus by feeding on infected primates (human or non-human) and then can transmit the virus to other primates (human or non-human). Yellow fever is an acute viral hemorrhagic disease transmitted by the Aedes aegypti species, which sends the virus from person to person. Yellow fever is spread through three transmission cycles; urban, sylvatic, and intermediate. An intermediate cycle exists where semi-domestic mosquitoes of the Aedes species serve as vectors.</p>\n<p><strong>Random:</strong></p><p>YELLOW FEVER TRANSMISSION CYCLE</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Yellow fever vaccine is produced by?", "options": [{"label": "A", "text": "Haffkine Institute, Mumbai", "correct": false}, {"label": "B", "text": "Central Research Institute, Kasauli", "correct": true}, {"label": "C", "text": "AIIMS, Delhi", "correct": false}, {"label": "D", "text": "NIN, Hyderabad", "correct": false}], "correct_answer": "B. Central Research Institute, Kasauli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Central Research Institute, Kasauli Yellow fever is a severe viral infection spread by a mosquito known as the Aedes aegypti mosquito. Yellow fever vaccination. This vaccination is mandatory for international travel to African and South American countries. Yellow Fever Vaccine is produced by Central Research Institute - CRI Kasauli. The institute is importing and distributing yellow fever vaccines to authorized yellow fever centers to immunize international travelers.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Gold standard investigation for Zika virus:", "options": [{"label": "A", "text": "PCR", "correct": false}, {"label": "B", "text": "Plaque reduction neutralization test", "correct": false}, {"label": "C", "text": "IgM Antibodies", "correct": false}, {"label": "D", "text": "RT-PCR", "correct": true}], "correct_answer": "D. RT-PCR", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>RT-PCR Molecular diagnostics based on RT-PCR are precise, sensitive, and considered the “gold standard” for ZIKA detection. RT-PCR is effective in serum, semen, and saliva within <14 days post-infection and possibly much longer in urine and semen. Diagnostic testing for Zika virus infection can be accomplished using molecular and serologic methods. Testing is available through commercial laboratories. The current gold standard diagnostic test identifies the presence of Zika virus RNA in blood or urine. Currently, the diagnosis of ZIKV is carried out with direct methods to detect viral RNA, such as RT-qPCR and viral isolation, which are considered the gold standard for the definitive diagnosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cell infected with ………………… can show hemadsorption activity:", "options": [{"label": "A", "text": "Adenovirus", "correct": false}, {"label": "B", "text": "Polyomavirus", "correct": false}, {"label": "C", "text": "Influenza virus", "correct": true}, {"label": "D", "text": "Parvovirus", "correct": false}], "correct_answer": "C. Influenza virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Influenza virus Influenza, commonly known as \"the flu,\" is an infectious disease caused by an influenza virus. Influenza viruses are members of the family Orthomyxoviridae. This family represents enveloped viruses, the genome comprising segmented negative-sense single-strand RNA segments. Hemagglutinin (HA) or Haemagglutinin (BE) is an antigenic glycoprotein found on the surface of influenza viruses. It is responsible for binding the virus to the cell that is being infected.</p>\n<p><strong>Extraedge:</strong></p><p>Hemagglutination-inhibition (HI) assay is a classical laboratory procedure for classifying or subtyping hemagglutinating viruses. HI, the assay is used for the influenza virus to identify the hemagglutinin (HA) subtype of an unknown isolate or the HA subtype specificity of antibodies to the influenza virus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Coenurus is the larval form of -", "options": [{"label": "A", "text": "Taenia solium", "correct": false}, {"label": "B", "text": "Taenia saginata", "correct": false}, {"label": "C", "text": "Taenia multiceps", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Taenia multiceps", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Taenia multiceps Coenurus is the larval form of Taenia multiceps with multiple scolices, unlike cysticercus with a single scolex. This species of Taenia may occasionally cause human disease resembling cysticercosis. The definitive host is wolves/ dogs/foxes, and the intermediate host is sheep/ cattle/ horses. Humans become intermediate hosts when they ingest food/water contaminated with feces containing T. multiceps eggs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Cysticercus cellulose is the larval form of Taenia solium. Option B. Cysticercus bovis is the larval form of Taenia saginata.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Choose the incorrect statement about poliovirus:", "options": [{"label": "A", "text": "Type 2 serotype leads to VDPV", "correct": false}, {"label": "B", "text": "Type 3 serotype leads to VAPP.", "correct": false}, {"label": "C", "text": "VAPP causes paralytic outbreaks", "correct": true}, {"label": "D", "text": "Switching from trivalent to bivalent OPV prevents VDPP.", "correct": false}], "correct_answer": "C. VAPP causes paralytic outbreaks", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>VAPP causes paralytic outbreaks VDPP causes paralysis outbreaks, not VAPP.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. VDPV = vaccine-derived paralytic polio due to type 2 serotype or improper vaccine coverage. Option B. VAPP = vaccine-associated paralytic polio due to minor mutations in the type 3 serotype. Option D. Bivalent OPV doesn’t have a type 2 serotype, so there are no chances of VDPP.</p>\n<p><strong>Extraedge:</strong></p><p>VAPP-Vaccine Associated Paralytic Polio VDPV- Vaccine derived Paralytic Virus Dreaded complication of OPV Complication associated with OPV Seen in both Recipient and contact Generally, maximum risk seen with 1st dose of OPV Three type CVDPV, iVDPV, aVDPV MC,seen with Sabin 3>2>1 virus MC,seen with Sabin virus 2 HIV is not risk factor for VAPP HIV is risk factor Not causes outbreaks Can leads to outbreaks( mc transmitted by feco-oral rout) The attenuated vaccine virus get genetically changed in the intestine & gain its neurovirulence leading to paralysis attenuated vaccine virus reacquire neurovirulence and transmission capacity through replication and genetic divergence effect by (it take 16-18 months PV 1 & 3-genetic divergence >1% or > 10 nt chng PV 2-gent divergence >0.6% or > 6 nucleotide chng</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 22 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 45-year-old Sailor comes to the office with groin pain and swelling. About a month ago, he noticed a sore on his penis but did not seek medical attention because the ulcer was not painful and disappeared within a week. Several days ago, he began to experience painful swelling in his inguinal region, with inflammation of the overlying skin and the eventual formation of several draining ulcers. He also has a mild fever and malaise that began around the same time as his groin symptoms. His other medical problems include well-controlled hypertension and hyperlipidemia. Cell scrapings from his lesions show cytoplasmic inclusion bodies. Which of the following is the most likely cause of this patient's condition?", "options": [{"label": "A", "text": "Chlamydia trachomatis", "correct": true}, {"label": "B", "text": "Haemophilus ducreyi", "correct": false}, {"label": "C", "text": "Herpes simplex virus", "correct": false}, {"label": "D", "text": "Klebsiella granulomatis", "correct": false}], "correct_answer": "A. Chlamydia trachomatis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlamydia trachomatis Chlamydia trachomatis is a small, gram-negative (albeit difficult to stain), obligate intracellular bacterium.</p>\n<p><strong>Highyeild:</strong></p><p>Serotypes A through C cause ocular infection (trachoma) in children; serotypes D through K cause urogenital (sexually transmitted) infections and inclusion conjunctivitis; and serotypes L 1 through L3 cause lymphogranuloma venereum (LGV). LGV is characterized initially by a painless, small, shallow genital ulcer containing infected cells. The painless nature helps distinguish LGV from other diseases. The appearance of the ulcer is followed weeks later by swollen, painful, c oalescing inguinal nodes (\"buboes\"- Groove’s sign- due to the thickening of the inguinal ligament, separating the lymph nodes) that can develop stellate abscesses and rupture . If left untreated, LGV can cause fibrosis, lymphatic obstruction, and anogenital strictures and fistulas. Histologically, LGV lesions contain areas of mixed granulomatous and neutrophilic inflammation with intracytoplasmic chlamydial Inclusion bodies in epithelial and inflammatory cells. Doxycycline is recommended.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: Haemophilus ducreyi causes chancroid, an ulcerative, sexually transmitted infection characterized by painful (rather than painless) red papules on the genitals that eventually erode to become tender ulcers (you \"do cry\" with H ducreyi). Regional lymph nodes may swell and become chronic ulcers. Option C: Herpes simplex virus type 2 is the most common cause of genital herpes, characterized by vesicles that develop into shallow, painful ulcers. These lesions often heal within 10 days. Histologically, multinucleated giant cells and large pinkish-purple intranuclear (not intracytoplasmic) inclusions, t ermed Cowdry type A bodies, are present. Option D: Klebsiella granulomatous causes granuloma inguinale (donovanosis) , which also initially manifests as a painless genital papule that eventually ulcerates; however, lymphadenopathy is uncommon. Intracytoplasmic Donovan bodies (bipolar stained klebsiella granulomatis) are diagnostic. I f donovanosis is untreated, scarring and strictures can lead to severe lymphatic obstruction and lymphedema (elephantiasis).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 19-year-old man comes to the office with an ulcer on his penis. The patient first noticed the lesion 3 days ago. His temperature is 37.1 C (98.8 F). Physical examination shows an indurated and painless ulcer near the glans penis, with no surrounding erythema and no inguinal lymphadenopathy. The patient is a college student. He has no significant past medical history and takes no medications. He has no known drug allergies. The first-line treatment for this patient has structural similarities with which of the following?", "options": [{"label": "A", "text": "D-alanine-D-alanine", "correct": true}, {"label": "B", "text": "D-glutamic acid-D-glutamic acid", "correct": false}, {"label": "C", "text": "Folic acid", "correct": false}, {"label": "D", "text": "L-alanine-D-glutamine", "correct": false}], "correct_answer": "A. D-alanine-D-alanine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>D-alanine-D-alanine This patient likely has a chance due to primary syphilis, a sexually transmitted infection caused by the spirochete Treponema pallidum. Spirochetes are universally sensitive to penicillin because they are all gram-negative organisms with a peptidoglycan cell wall. Penicillins work by covalently binding to and inhibiting transpeptidase. This enzyme catalyzes the final cross-linking step in peptidoglycan cell wall formation : the joining of the amino acid in the third position of a peptidoglycan molecule to the terminal D-alanine-D-alanine of another peptidoglycan molecule. The structural similarity of penicillins to D-alanine-D-alanine likely facilitates their binding to transpeptidase. When transpeptidase is inhibited, cell wall synthesis ceases and cell wall degradation by bacterial autolysins proceeds unchecked. The weakened cell wall integrity causes osmotic lysis of the bacterium. Vancomycin, a glycopeptide antibiotic, directly binds to the D-alanine-D-alanine residues, preventing the incorporation of new subunits into the cell wall. Vancomycin acts at an earlier stage of cell wall formation than do the penicillins.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B and D: D-glutamic acid-D-glutamic acid and L-alanine-D-glutamine are not sequences targeted by transpeptidase. Penicillin is not a structural analog of either molecule. Option C: Sulfonamide antibiotics are antimetabolites that compete with para-aminobenzoic acid for incorporation into folic acid. Trimethoprim blocks another step in folic acid synthesis by inhibiting the enzyme dihydrofolate reductase.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 20-year-old woman comes to the urgent care center due to 3 days of dyspareunia and dysuria. She also had a low-grade fever and a mild headache. The patient is otherwise healthy and takes oral contraceptives for contraception. She has no history of urinary tract infections or sexually transmitted infections. She is sexually active and recently began a monogamous relationship with a new partner. Her boyfriend uses condoms inconsistently. On examination, she is afebrile. She is uncomfortable but in no acute distress. Her abdomen is soft and non-tender. Genital examination reveals multiple, painful, shallow ulcers with an erythematous base on the left labia. There is no vaginal discharge. Internal examination reveals no cervical motion tenderness. She has bilateral tender inguinal lymphadenopathy. Which of the following is the best diagnostic test for this patient's condition?", "options": [{"label": "A", "text": "Darkfield microscopy", "correct": false}, {"label": "B", "text": "Gram stain of the ulcer swab", "correct": false}, {"label": "C", "text": "Lymph node biopsy", "correct": false}, {"label": "D", "text": "Polymerase chain reaction for viral DNA", "correct": true}], "correct_answer": "D. Polymerase chain reaction for viral DNA", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polymerase chain reaction for viral DNA Primary genital herpes simplex virus (HSV) infection is the most likely diagnosis in this patient who has multiple painful genital ulcers (with a characteristic erythematous base), dysuria (likely due to irritation from the ulcers), tender lymphadenopathy (common with primary genital HSV infection), and systemic symptoms (fever, headache) in the setting of having a new sexual partner.</p>\n<p><strong>Highyeild:</strong></p><p>Genital Herpes: HSV infection can be diagnosed using polymerase chain reaction (PCR), direct fluorescence antibody, viral culture (low sensitivity), or Tzanck smear (showing multinucleated giant cells</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Darkfield microscopy can be used to diagnose syphilis, which typically presents with painless ulceration (chancre). Option B: gram stain is diagnostic for a) Gonorrhea , caused by Neisseria gonorrhoeae, is a common cause of urethritis, cervicitis, and pelvic inflammatory disease in sexually active females. Gram stain can reveal gram-negative diplococci . b) Chancroid (due to Haemophilus ducreyi) presents with purulent ulcers with \"ragged\" borders and suppurative lymphadenopathy. Gram stain may occasionally reveal gram-negative rods in a \"school of fish\"pattern. Option C: Lymph node biopsy is a relatively invasive procedure typically used to exclude malignancy or certain infections such as tuberculosis. Biopsies of genital lesions may be performed if the diagnosis is unclear or if there is no response to initial treatment.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following statements are true about secondary syphilis except:", "options": [{"label": "A", "text": "The second stage develops months after the primary lesion heals", "correct": false}, {"label": "B", "text": "Produce mucocutaneous lesions", "correct": false}, {"label": "C", "text": "VDRL and TPHA tests are 100% positive", "correct": false}, {"label": "D", "text": "Lesions are not infectious in the secondary stage", "correct": true}], "correct_answer": "D. Lesions are not infectious in the secondary stage", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lesions are not infectious in the secondary stage Lesions in s econdary syphilis are highly contagious. These consist of a red maculopapular rash anywhere on the body, including the hands and feet, and moist, pale papules (condylomas) in the anogenital region, axillae, and mouth. The secondary lesions may subside spontaneously. Both primary and secondary lesions are rich in spirochetes and are highly infectious.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. It usually develops 4–8 weeks after the healing of the primary lesion and is characterized by: Rashes (palms and soles) Condylomata lata (mucocutaneous lesion) - Option B Mucous patches (superficial mucosal erosions) Generalized lymphadenopathy A person is highly contagious during the secondary stage. The characteristic rash from secondary syphilis appears as rough, reddish-brown spots that usually appear on the palms of the hands or bottoms of the feet. It may be missed in dark-skinned patients. The rash is typically painless and does not itch. It may appear in one area of the body or spread to multiple areas. Option C: VDRL and TPHA are 100% positive. All tests for secondary syphilis are 100% sensitive.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old patient presents with vaginal discharge. Laboratory diagnosis reveals chlamydial infection. The treatment of choice is-", "options": [{"label": "A", "text": "Doxycycline with Metronidazole", "correct": false}, {"label": "B", "text": "Azithromycin with contact tracing", "correct": true}, {"label": "C", "text": "Fluconazole with doxycycline", "correct": false}, {"label": "D", "text": "Metronidazole", "correct": false}], "correct_answer": "B. Azithromycin with contact tracing", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Azithromycin with contact tracing Chlamydia is a sexually transmitted infection that may not present any noticeable symptoms. Although sometimes without symptoms, delaying treatment. Week-long courses of doxycycline and a single 1 gm dose of azithromycin are 96-98% effective in curing chlamydial infection as determined by isolation in cell culture. Ofloxacin (but not all other quinolones) is effective in treating chlamydial infections. CDC recommends azithromycin (especially in pregnancy) and doxycycline as first-line drugs for the treatment of chlamydial infection. Medical treatment with these agents is 95 percent effective. Alternative agents include erythromycin, levofloxacin, and ofloxacin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Doxycycline with Metronidazole - not the correct option as metronidazole is not used in the treatment Option C. Fluconazole with doxycycline - is not the correct option as fluconazole is used to treat candida infections. Option D. Metronidazole - not the correct option. Its used to treat trichomonas vaginalis or bacterial vaginosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 27-year-old white man presents to his family doctor complaining of being tired all the time and having a slight fever for the past two weeks. He had a trip to Las Vegas 3 months back, where he indulged in some of the infamous nightlife. His physical exam is unremarkable except for a macular rash over his trunk and on the palms of his hands. There are no lesions or ulcers on the penis. What organism is causing this man's illness?", "options": [{"label": "A", "text": "Chlamydia trachomatis", "correct": false}, {"label": "B", "text": "Neisseria gonorrhea", "correct": false}, {"label": "C", "text": "Treponema pallidum", "correct": true}, {"label": "D", "text": "Borrelia burgdorferi", "correct": false}], "correct_answer": "C. Treponema pallidum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Treponema pallidum The question describes secondary syphilis- the typical maculopapular generalized rash. No history of primary chancre, as mentioned in the question is not an unusual finding because as the ulcer is painless it can occur at a visually inaccessible site and may go unnoticed by the patient.</p>\n<p><strong>Highyeild:</strong></p><p>Stages of Syphilis: Primary syphilis — incubation period 14 days - 3 months, a painless, erythematous papule develops which ulcerates and forms a painless, ‘punched-out’ chancre on the genitalia (rarely on the mouth, hands, and anus). Associated with regional lymphadenopathy. They are highly infectious and heal spontaneously after 1– 2 months. Secondary syphilis — organisms disseminate from the chancre, causing symptoms 1– 6 months later: Characteristic rash— localized or diffuse mucocutaneous rash may be macular, papular, pustular, or maculopapular, involving the entire body along with palms and soles. Mucosal ulcers may occur. Condylomata lata occurs in warm, moist areas (e.g. skinfolds) and is highly infectious; Latent syphilis— spontaneous resolution of secondary syphilis occurs at 3– 12 weeks. During the latent period, patients are asymptomatic, and infectivity is low but may experience recrudescence of disease. Early latent syphilis is the period up to 2 years after primary infection, and late latent syphilis occurs after 2 years. Late/ tertiary syphilis — Rare , follows a latent period of 2– 20 years; due to chronic inflammation: Gummatous syphilis — granulomatous lesions usually affecting the skin, mucous membranes, and bone or organs, causing local destruction. Cardiovascular syphilis — endarteritis of the aorta causing aortic regurgitation VDRL can be negative. Late neurosyphilis — Two forms: (i) general paresis of the insane (ii) tabes dorsalis (atrophy of the dorsal columns of the spinal cord with autonomic neuropathy and cranial nerve lesions).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 30-year-old presents with a two-week history of a penile ulcer. He noted that this ulcer did not hurt and had punched out margins. Which one of the following conclusions/actions is most valid?", "options": [{"label": "A", "text": "Draw blood for a herpes antibody test", "correct": false}, {"label": "B", "text": "Even if treated, the lesion will remain for months", "correct": false}, {"label": "C", "text": "Failure to treat the patient will have no untoward effect, as this is a self-limiting infection", "correct": false}, {"label": "D", "text": "Perform a dark-field examination of the lesion", "correct": true}], "correct_answer": "D. Perform a dark-field examination of the lesion", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Perform a dark-field examination of the lesion Sexually transmitted genital ulcers are mostly caused by herpes, syphilis, chancroid, and Chlamydia. Genital ulcers may also be caused by inflammatory diseases, trauma, or a bad reaction to skin care products. This question points towards syphilis as a diagnosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Herpes simplex ulcers are usually painful and multiple. Option B: This option is wrong as the painless lesion of syphilis heals with or without treatment. Option C: if left untreated in the primary stage syphilis proceeds to secondary and fatal tertiary stages.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Syphilis is a bacterial infection usually spread by sexual contact. The disease starts as a painless sore — typically on the genitals, rectum, or mouth. Syphilis spreads from person to person via skin or mucous membrane contact with these sores. Which of the following is incorrect regarding syphilis:", "options": [{"label": "A", "text": "The most sensitive test is FTA-ABS.", "correct": false}, {"label": "B", "text": "The most specific test is TPI.", "correct": false}, {"label": "C", "text": "The first test to become positive is the Wassermann test.", "correct": true}, {"label": "D", "text": "The test detects non-specific antibodies to cardiolipin antigen.", "correct": false}], "correct_answer": "C. The first test to become positive is the Wassermann test.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The first test to become positive is the Wassermann test. The Wassermann test is obsolete and has been replaced by other better and specific syphilis tests.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: FTA-ABS test has a good sensitivity as a screening test. Option B: The TPI test appears to be unequivocally the test of choice for the diagnosis of late and latent syphilis. It is a test with high specificity. Option D: VDRL detects non-specific antibodies to cardiolipin antigen and thus can be positive in non-T. palladium infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Dark ground microscopy is useful in the following investigation for syphilis:", "options": [{"label": "A", "text": "Treponema pallidum immobilization (TPI) test", "correct": true}, {"label": "B", "text": "FTA-ABS", "correct": false}, {"label": "C", "text": "FTA-ABS-IgM", "correct": false}, {"label": "D", "text": "VDRL", "correct": false}], "correct_answer": "A. Treponema pallidum immobilization (TPI) test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Treponema pallidum immobilization (TPI) test Darkfield microscopy allows visualization of live treponemes obtained from the chancre. TPI ( Treponema pallidum immobilization) tests demonstrate the loss of motility of the spirochetes when provided with appropriate complements and antibodies present in the patient sera.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B and C: both tests require a fluorescent microscope. Option D: VDRL is visualized with a light microscope.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Syphilis develops in stages and symptoms vary with each stage. Which of the following test is not recommended for the diagnosis of Syphilis?", "options": [{"label": "A", "text": "VDRL test", "correct": false}, {"label": "B", "text": "Culture", "correct": true}, {"label": "C", "text": "FTA-ABS test", "correct": false}, {"label": "D", "text": "MHA-TP test Treponema pallidum", "correct": false}], "correct_answer": "B. Culture", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Culture The etiological agent, Treponema pallidum, cannot be cultured, and there is no single optimal alternative test. It is a diagnosis made mostly based on serological testing and direct visualization of the spirochetes on darkfield microscopy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D are tests used for the diagnosis of syphilis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The Venereal Disease Research Laboratory test is a blood test for syphilis and related non-venereal treponematoses that was developed by the eponymous lab. All of the following are true regarding the VDRL test except:", "options": [{"label": "A", "text": "Positive in secondary syphilis.", "correct": false}, {"label": "B", "text": "False positive reactions can occur", "correct": false}, {"label": "C", "text": "Titers decrease with treatment.", "correct": false}, {"label": "D", "text": "The antigen is prepared from killed Treponema pallidum.", "correct": true}], "correct_answer": "D. The antigen is prepared from killed Treponema pallidum.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The antigen is prepared from killed Treponema pallidum. The Venereal Disease Research Laboratory (VDRL) test is a slide flocculation test for syphilis that uses an antigen (referred to as VDRL antigen) c ontaining 0.03% cardiolipin, 0.21% lecithin, and 0.9% cholesterol.</p>\n<p><strong>Highyeild:</strong></p><p>Biological False Positives (Bfps) Biologic false-positive reactions have been reported in pregnancy, older age, autoimmune diseases, intravenous drug users, and HIV, HBV, and hepatitis C seropositive patients. BFPs are usually associated with low VDRL titers (<or=1:8) The test is to be repeated after 6-10 weeks, by that time the false positivity subsides.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: The VDRL test is a screening test for syphilis. Option B: Biological false positives are common in syphilis. Option C: as the treatment progresses, the titers of the VDRL test start to fall responding to the treatment. Options A, B, and C are all correct about VDRL.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-year-old sexually active woman presents for her annual well-woman exam. She at times has a low-grade fever and lately has noticed a rash on her face, mainly on the cheeks. She is saddened to learn she has a positive VDRL test for syphilis. However, she is asymptomatic for syphilis and is in a monogamous relationship with her husband who has not had any other sexual contacts. Which of the following is the most likely reason for the positive syphilis test?", "options": [{"label": "A", "text": "She has secondary syphilis.", "correct": false}, {"label": "B", "text": "She has HIV, altering her immune reaction.", "correct": false}, {"label": "C", "text": "She had exposure to syphilis earlier this week.", "correct": false}, {"label": "D", "text": "She has systemic lupus erythematosus (SLE).", "correct": true}], "correct_answer": "D. She has systemic lupus erythematosus (SLE).", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>She has systemic lupus erythematosus (SLE). This patient has a Biological False positive VDRL test due to the autoimmune disease i.e. SLE. VDRL is a non-specific treponemal test and is positive in many other non-specific conditions. Therefore it is always confirmed by a specific treponemal test (TPPA, TPHA) .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 21-year-old woman visits her obstetrician and is later diagnosed with secondary syphilis. On further questioning, it is determined she is allergic to penicillin. Because Treponema pallidum is known to cross the placenta, treatment is started immediately. Which antibiotic would be most appropriate in this situation?", "options": [{"label": "A", "text": "Tetracycline", "correct": false}, {"label": "B", "text": "Ceftriaxone", "correct": false}, {"label": "C", "text": "Penicillin G", "correct": true}, {"label": "D", "text": "Erythromycin", "correct": false}], "correct_answer": "C. Penicillin G", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Penicillin G Penicillin G is the only known effective antimicrobial for preventing maternal transmission to the fetus and treating fetal infection. Therefore in penicillin-allergic patients, desensitization of penicillin is required before starting the treatment . Pregnant women with diagnosed syphilis should be treated immediately. Penicillin is effective in curing syphilis during pregnancy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Tetracycline - not the appropriate antibiotic. Option B. Ceftriaxone - efficacy is doubtful in syphilis Option D. Erythromycin - does not cross the placental barrier effectively. Option A. B and D are not the appropriate antibiotics in this clinical case.</p>\n<p><strong>Extraedge:</strong></p><p>If penicillin desensitization is not possible: Alternative regimens: erythromycin ceftriaxone azithromycin The child born to women treated with alternate drugs other than penicillin should be vigorously treated postnatally.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old woman who is 10 weeks pregnant presents to the Obstetrics clinic for prenatal care. She has a history of treatment for syphilis 7 years previously. The results of serologic tests for syphilis are as follows: Non treponemal test RPR (rapid plasma reagin) : Nonreactive, Treponemal test (TP-PA) reactive.Which of the following statement is most correct?", "options": [{"label": "A", "text": "The baby is at high risk for congenital syphilis", "correct": false}, {"label": "B", "text": "The mother needs a lumbar puncture and a VDRL Venereal disease research laboratory test for her CSF Cerebrospinal fluid for neurosyphilis", "correct": false}, {"label": "C", "text": "The mother needs to be treated again for syphilis", "correct": false}, {"label": "D", "text": "The mother’s previous treatment for syphilis was effective", "correct": true}], "correct_answer": "D. The mother’s previous treatment for syphilis was effective", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The mother’s previous treatment for syphilis was effective Congenital syphilis can have a major health impact on a baby, but how it affects the baby's health depends on when syphilis was acquired in pregnancy and if — or when — the mother received treatment for the infection. Highly specific; positive screening results must be followed by a nontreponemal antibody test to differentiate between active and past infection. These antibodies remain positive for life even after treatment. Mother-to-child transmission of syphilis (congenital syphilis) is usually devastating to the fetus if maternal infection is not detected and treated sufficiently early.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: is incorrect Options B and C are also incorrect for the same reason as explained above.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Congenital syphilis is a severe, disabling, and often life-threatening infection seen in infants whose mothers were infected and not fully treated. The infection can pass through the placenta to the unborn infant during pregnancy. Congenital syphilis can be best diagnosed by:", "options": [{"label": "A", "text": "IgM FTA-ABS", "correct": true}, {"label": "B", "text": "IgG FTA-ABS", "correct": false}, {"label": "C", "text": "VDRL Venereal disease research laboratory test on serum", "correct": false}, {"label": "D", "text": "RPR", "correct": false}], "correct_answer": "A. IgM FTA-ABS", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IgM FTA-ABS Because IgM does not cross the placenta, a positive IgM is consistent with congenital infection. The sensitivity of the IgM Western blot is approximately 83%, with a specificity of 90%. The diagnosis of congenital syphilis in the newborn can present a major diagnostic treponemal antibody ( IgM FTA) test in sera from neonates. A confirmed case of congenital syphilis is an infant in whom Treponema pallidum is identified by darkfield microscopy (from skin lesions/ blisters), fluorescent antibody, or other specific tests (TPPA) from infant blood.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C: VDRL as a single diagnostic test is not of any value in the diagnosis of congenital syphilis. VDRL positive in neonatal CSF is diagnostic. Option B: IgG will be present in neonatal blood due to the transfer maternal of antibodies to the child through the placenta. Option D: RPR: same explanation as VDRL. Options B, C, and D are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Syphilis develops in stages and symptoms vary with each stage. The first stage involves a painless sore on the genitals, rectum, or mouth. After the initial sore heals, the second stage is characterized by a rash. Then, there are no symptoms until the final stage which may occur years later. This final stage can result in damage to the brain, nerves, eyes, or heart. Syphilis is treated with penicillin. Sexual partners should also be treated. Patients with syphilis should be advised that:", "options": [{"label": "A", "text": "The patient may remain “Eurofast” or have positive treponemal serologic tests for life.", "correct": false}, {"label": "B", "text": "All at-risk sex partners need to be evaluated and possibly treated for syphilis, even if they have not noticed symptoms.", "correct": false}, {"label": "C", "text": "Untreated syphilis can lead to serious sequelae, including neurologic and cardiovascular disorders.", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above Option A. Adult applicants treated for syphilis should be informed by their physician that they will need follow-up care for clinical and serologic re-evaluation and will remain Serological tests positive throughout life. Option B. Sexual contacts of individuals diagnosed with early syphilis should be tested after thorough testing for syphilis. Option C. syphilis is associated with serious sequelae is remained untreated. Such as endarteritis of the aorta leads to aortic regurgitation (may present with angina and left ventricular failure general paresis of the insane (presents with gradual confusion, hallucinations, delusions, fits, cognitive impairment, tremors of the lips and tongue, brisk reflexes, extensor planter, Argyll Robertson pupils), and t abes dorsalis (atrophy of the dorsal columns of the spinal cord with autonomic neuropathy and cranial nerve lesions. Options A, B, and C all are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not true about yaws:", "options": [{"label": "A", "text": "No primary lesion seen", "correct": true}, {"label": "B", "text": "Caused by T. pertenue", "correct": false}, {"label": "C", "text": "Has cross-immunity with syphilis", "correct": false}, {"label": "D", "text": "Cannot be differentiated from T. pallidum by certain serological tests", "correct": false}], "correct_answer": "A. No primary lesion seen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>No primary lesion seen Yaws is a poverty-related chronic skin disease that affects mainly children below 15 years of age (with a peak between 6 and 10 years).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: It is caused by the bacterium - a Treponema Pallidum subspecies pertenue and transmitted by skin contact. Yaws mainly affect the skin, but can also involve the bone and cartilage. a Primary yaws: 'Split-papules' may occur at the angle of the mouth. Regional lymphadenopathy is common. Option C: In contrast to syphilis, genital lesions are rare. Has cross-immunity with syphilis. Option D: Primary lesions are indolent and take 3-6 months to heal, more often leaving a pigmented scar. It cannot be differentiated from T. pallidum Options B, C, and D are correct statements for yaws.</p>\n<p><strong>Extraedge:</strong></p><p>Eradication Of Yaws In India, the last cases of yaws were reported in 2003 . After 3 years of no new cases, India declared interruption of transmission (elimination) of yaws.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 37-year-old newly married man presents with multiple blister-like lesions on the glans of his penis, appearing over the past 2 days. On questioning, he recalls similar episodes over the past 2 years. The Examination is remarkable for tender, 3-4 mm vesicular lesions on the shaft of his penis with no apparent crusting, drainage, or bleeding. There is also slight bilateral inguinal adenopathy. During the asymptomatic period between outbreaks, where would the causative agent likely have been found?", "options": [{"label": "A", "text": "Fibroblasts", "correct": false}, {"label": "B", "text": "Lymphocytes", "correct": false}, {"label": "C", "text": "Neurons of the sacral ganglia", "correct": true}, {"label": "D", "text": "Mucoepithelial cells", "correct": false}], "correct_answer": "C. Neurons of the sacral ganglia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neurons of the sacral ganglia HSV-1 and HSV-2 infect epithelial cells and establish latent infections in neurons (remains latent in sensory ganglia) Type 1 is classically associated with oropharyngeal lesions and causes recurrent attacks of “fever blisters.” Type 2 primarily infects the genital mucosa and is mainly responsible for genital herpes, though the anatomical specificity of these viruses is diminishing. Both viruses can also cause neurologic diseases. HSV-1 is the leading viral cause of sporadic encephalitis. Both types 1 and 2 can cause neonatal infections that are often severe.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following viruses, in addition to HSV-1 and HSV-2, produces the cytopathologic findings of multinucleated giant cells?", "options": [{"label": "A", "text": "Adenovirus", "correct": false}, {"label": "B", "text": "Cytomegalovirus", "correct": false}, {"label": "C", "text": "Human papillomavirus", "correct": false}, {"label": "D", "text": "Varicella-zoster virus", "correct": true}], "correct_answer": "D. Varicella-zoster virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Varicella-zoster virus The multinucleated giant cells CPE is associated with herpes virus 1,2 and VZV. CMV produces large owl eye cell changes. HPV causes atypical cellular changes</p>\n<p><strong>Highyeild:</strong></p><p>Some viruses produce a characteristic cytopathic effect (CPE) in cell culture (shrinking, swelling, rounding of cells, formation of syncytia or clusters), making a rapid presumptive diagnosis possible when the clinical syndrome is known. The respiratory syncytial virus produces multinucleated giant cells (syncytia), Adenoviruses produce grapelike clusters of large round cells. Rubella produces no direct cytopathic changes but can be detected by its interference with the CPE of a second challenge virus (viral interference). Influenza viruses and some paramyxoviruses may be detected within 24–48 hours if erythrocytes are added to infected cultures. Enterovirus infection showing cell rounding</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "LGV is a long-term (chronic) infection of the lymphatic system. It is caused by certain strains of the bacteria. Which of the following causes Lymphogranuloma venereum?", "options": [{"label": "A", "text": "Rickettsiae", "correct": false}, {"label": "B", "text": "Chlamydia", "correct": true}, {"label": "C", "text": "Fungus", "correct": false}, {"label": "D", "text": "Gram-positive bacteria", "correct": false}], "correct_answer": "B. Chlamydia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlamydia Lymphogranuloma Venereum LGV is caused by C. trachomatis L1, L2, and L3. In the primary stage, it is characterized by a painless transient papulovesicular lesion o n the genitals. In the secondary stage, there is regional lymphadenopathy. These lymph nodes may be suppurate. Metastasis may occur in the joints, eyes, and meninges. The tertiary stage is characterized by genital elephantiasis due to scarring and lymphatic blockage. Treatment with doxycycline- 100mg BD for 21 days.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Rickettsiae comprise small obligate intracellular organisms. They are non-cultivable in artificial media, although they can grow in cell lines, or by animal and egg inoculation. They are transmitted by arthropod vectors, such as ticks. mite, flea, or louse. Option C: Fungi are not a cause of LGV. Option D: LGV is not caused by Gram-positive bacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 30 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 35-year-old man is found to have elevated alanine aminotransferase and aspartate aminotransferase levels. He has no abdominal pain, nausea, or vomiting. The patient has used intravenous drugs but denies significant alcohol use. His past medical history is negative for blood transfusions or excessive acetaminophen use. Physical examination findings are normal. Laboratory studies show high titers of IgG directed against the hepatitis C envelope protein. Which of the following is the most likely reason these antibodies do not confer effective immunity against the infection?", "options": [{"label": "A", "text": "Envelope proteins are lost after recurrent viral replication", "correct": false}, {"label": "B", "text": "Envelope proteins are sequestered within hepatocytes", "correct": false}, {"label": "C", "text": "Envelope proteins have low immunogenicity", "correct": false}, {"label": "D", "text": "Envelope proteins have variations in their antigenic structure", "correct": true}], "correct_answer": "D. Envelope proteins have variations in their antigenic structure", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Envelope proteins have variations in their antigenic structure Hepatitis C virus (HCV) has six or more genotypes and multiple subtypes that differ in genomic composition by as much as 30%-35%. This is mainly because the virion-encoded RNA-dependent RNA polymerase has no proofreading 3'-->5' exonuclease activity, resulting in many replication errors. Although most patients have a single genotype, the high mutation rate leads to distinct quasispecies within infected individuals over time. These variant strains differ primarily at hypervariable genomic regions, such as those found in the sequences coding for its envelope glycoproteins. The continuous generation of novel envelope glycoproteins prevents infected individuals from mounting an effective immune response. As the production of host antibodies against a quasispecies commences, that strain dies off, and new ones occur. The tremendous antigenic variety of HCV has significantly slowed efforts to develop an effective vaccine.</p>\n<p><strong>Highyeild:</strong></p><p>Anti-HCV HCV RNA Nonreactive Negative Negative Current Infection Positive Positive Past Infection Positive Negative</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & B. The envelope proteins of HCV are not lost after recurrent viral replication, nor are they sequestered within hepatocytes. These proteins are necessary for viral infectivity, mediating membrane adhesion, and fusion with host hepatocytes. Option C. Like most foreign (nonself) proteins, the envelope proteins of HCV are highly immunogenic.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis C-Related Extrahepatic Manifestations Symptom/Manifestation Potential HCV-Related Syndrome Hypertension Membranoproliferative glomerulonephritis Nephropathy Cryoglobulinemia Skin disease Lichen planus Porphyria cutanea tarda Leukocytoclastic vasculitis Cryoglobulinemia vasculitis Purpura Cryoglobulinemic vasculitis Leukocytoclastic vasculitis Distal neuropathic pain Membranoproliferative glomerulonephritis without cryoglobulin Cryoglobulinemia-Membranoproliferative glomerulonephritis Renal insufficiency Hematuria Membranoproliferative glomerulonephritis without cryoglobulin Cryoglobulinemia-Membranoproliferative glomerulonephritis Lymphadenopathy Lymphoproliferative disorder Fever Cryoglobulinemia Cryoglobulinemic vasculitis Lymphoproliferative disorder Arthralgia, weakness Cryoglobulinemia Lymphoma Cryoglobulinemic vasculitis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old man comes to the emergency department after five days of progressive anorexia, nausea, and abdominal pain. The patient is a known hepatitis B carrier. He admits to using IV drugs and has shared needles with other drug users several times. His temperature is 37.7 C (99.9 F). Examination shows scleral icterus and mild, tender hepatomegaly. Laboratory studies are notable for highly elevated levels of liver aminotransferases and serum bilirubin and also offer the following results: Hepatitis B surface antigen + Hepatitis C virus antibody - HIV-1 antibody - Hepatitis D RNA + This patient's chronic infection assists which life cycle aspects of the current infectious agent?", "options": [{"label": "A", "text": "Coating of viral particles", "correct": true}, {"label": "B", "text": "Integration into the host genome", "correct": false}, {"label": "C", "text": "Intracellular survival", "correct": false}, {"label": "D", "text": "Replication of viral RNA", "correct": false}], "correct_answer": "A. Coating of viral particles", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coating of viral particles Often referred to as the delta agent, hepatitis D virus (HDV) is a 35-nm, double-shelled particle that resembles the Dane particle of hepatitis B virus (HBV). The internal polypeptide assembly of HDV is designated hepatitis D antigen (HDAg). A very short, circular molecule of single-stranded RNA is associated with this antigen. HDAg is considered replication defective as it must be coated by the outer coat hepatitis B surface antigen (HBsAg) of HBV to penetrate the hepatocyte. HDV infection can arise either as an acute coinfection with HBV or as a superinfection of a chronic HBV carrier.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis D virus (HDV) is a virus that requires hepatitis B virus (HBV) for its replication. Hepatitis D virus (HDV) affects globally nearly 5% of people with a chronic infection with hepatitis B virus (HBV). HDV infection occurs when people become infected with hepatitis B and D simultaneously (co-infection) or get hepatitis D after first being infected with hepatitis B (super-infection).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. Once coated with HBsAg, HDV can penetrate the hepatocyte, survive within the cell, integrate into the host genome, replicate its viral RNA, and translate its genome into protein.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis C-Related Extrahepatic Manifestations Symptom/Manifestation Potential HCV-Related Syndrome Hypertension Membranoproliferative glomerulonephritis Nephropathy Cryoglobulinemia Skin disease Lichen planus Porphyria cutanea tarda Leukocytoclastic vasculitis Cryoglobulinemia vasculitis Purpura Cryoglobulinemic vasculitis Leukocytoclastic vasculitis Distal neuropathic pain Membranoproliferative glomerulonephritis without cryoglobulin Cryoglobulinemia-Membranoproliferative glomerulonephritis Renal insufficiency Hematuria Membranoproliferative glomerulonephritis without cryoglobulin Cryoglobulinemia-Membranoproliferative glomerulonephritis Lymphadenopathy Lymphoproliferative disorder Fever Cryoglobulinemia Cryoglobulinemic vasculitis Lymphoproliferative disorder Arthralgia, weakness Cryoglobulinemia Lymphoma Cryoglobulinemic vasculitis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An individual who has received all three doses of the hepatitis B vaccine and who has never had hepatitis B virus (HBV) infection would be expected to have which of the following serologic marker(s)?", "options": [{"label": "A", "text": "HBcAb", "correct": false}, {"label": "B", "text": "HBsAb", "correct": true}, {"label": "C", "text": "HBeAb", "correct": false}, {"label": "D", "text": "HBeAb and HBsAb", "correct": false}], "correct_answer": "B. HBsAb", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HBsAb HBsAb is a rapid, self-performing, immunochromatographic assay for detecting HBsAb in human serum.</p>\n<p><strong>Highyeild:</strong></p><p>Following an HBV infection, HBsAb is generally the last antibody to appear. Its presence indicates clinical recovery of the patient and subsequent immunity to HBV infection. HBV genes can be translated to surface antigen (HBsAg), e antigen (HBeAg), core antigen (HBcAg), polymerase, and X protein. HBsAg is the hallmark of HBV infection and is the first serological marker to appear in acute HBV infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. HBcAb indicates a past or current hepatitis B infection. Option C. The presence of HBeAb means there is an active hepatitis B infection, likely in someone with chronic hepatitis B. Option D. Double-positive hepatitis B virus infection could be due to infection of viruses of different serotypes.</p>\n<p><strong>Extraedge:</strong></p><p>The most significant difference between hepatitis B and hepatitis C is that people may get hepatitis B from contact with the bodily fluids of a person who has the infection. Hepatitis C usually only spreads through blood-to-blood contact.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "WHICH of the following is true about the hepatitis C virus:", "options": [{"label": "A", "text": "DNA virus", "correct": false}, {"label": "B", "text": "most typical indication for liver transplantation", "correct": true}, {"label": "C", "text": "Does not cause liver cancer", "correct": false}, {"label": "D", "text": "Does not cause coinfection with hepatitis B", "correct": false}], "correct_answer": "B. most typical indication for liver transplantation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>most typical indication for liver transplantation Hepatitis C is a liver disease caused by the hepatitis C virus (HCV); the virus can cause both acute and chronic hepatitis, ranging in severity from a mild illness lasting a few weeks to a serious, lifelong illness.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis C is a significant cause of liver cancer. Liver failure due to hepatitis C is one of the most common reasons for liver transplantation. But researchers can provide only rough estimates of the risk and rate of progression to liver failure in chronic hepatitis C. Without treatment, most people who get hepatitis C remain infected for life.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Hepatitis C virus is an RNA virus Option C. It usually causes liver disease, cirrhosis, and liver cancer is a common complication Option D. It may cause co-infection with hepatitis B</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis B is transmitted when blood, semen, or another body fluid from a person infected with HBV enters the body of someone who is not infected. This can happen through sexual contact; sharing needles, syringes, or other drug-injection equipment; or from mother to baby at birth.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "To which of the viruses is hepatitis A most closely related genetically:", "options": [{"label": "A", "text": "Hepatitis B", "correct": false}, {"label": "B", "text": "Poliovirus", "correct": true}, {"label": "C", "text": "Measles", "correct": false}, {"label": "D", "text": "Rubella", "correct": false}], "correct_answer": "B. Poliovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Poliovirus Hepatitis A virus (HAV), classified as hepatovirus, is a small, unenveloped symmetrical RNA virus that shares many of the characteristics of the picornavirus family and is the cause of infectious or epidemic hepatitis transmitted by the fecal-oral route.</p>\n<p><strong>Highyeild:</strong></p><p>Poliovirus belongs to the Picornavirus family. Therefore hepatitis A most closely related genetically to the Polio virus. The disease is closely associated with unsafe water or food. The hepatitis A virus is among the most frequent causes of foodborne infection. Hepatitis A of prototype enteroviruses and rhinoviruses, in particular poliovirus type 1. Poliovirus only infects people. It enters the body through the mouth and spreads through: contact with an infected person's feces (poop). Droplets from a sneeze or cough of an infected person (less common). The hepatitis A virus is transmitted primarily by the fecal-oral route when an uninfected person ingests food or water contaminated with the feces of an infected person.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Hepatitis B- DNA virus. Belong to Hepadnaviridae. Option C. Measles- RNA virus. Belong to Paramixoviridae. Option D. Rubella- RNA virus. Belong to Togaviridae.</p>\n<p><strong>Extraedge:</strong></p><p>Polio is caused by the poliovirus. It mainly targets nerve cells in the spinal cord and brain stem that control muscle movement. Nerve cells controlling sensation are generally not affected</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Acute Hepatitis A virus infection is best diagnosed by-", "options": [{"label": "A", "text": "IgM antibodies in serum", "correct": true}, {"label": "B", "text": "Isolation from stool", "correct": false}, {"label": "C", "text": "Culture from blood", "correct": false}, {"label": "D", "text": "Isolation from bile", "correct": false}], "correct_answer": "A. IgM antibodies in serum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IgM antibodies in serum The HAV IgM antibody test detects the first antibody produced by the body when it is exposed to hepatitis A. This test is used to detect early or recent infections and to diagnose the disease in people with symptoms of acute hepatitis. It may be performed as part of an acute viral hepatitis panel. This test looks for antibodies in your blood called IgM. The test can determine whether you are infected with the hepatitis A virus (HAV).</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis is an inflammation of your liver, often caused by an infection. Serological diagnosis of acute viral hepatitis A depends on detecting specific anti-HAV IgM. Its presence in the patient's serum indicates recent exposure to HAV.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. HaV can be diagnosed from feces, but it is not a very accurate method Option C. IgM antibodies in the blood are found, but again, not the most reliable method Option D. Not a definitive test.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis A is preventable by vaccine. It spreads from contaminated food or water or contact with someone who is infected. Symptoms include fatigue, nausea, abdominal pain, loss of appetite and low-grade fever. The condition clears up on its own in one or two months. Rest and adequate hydration can help.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In acute hepatitis B infection, which of the following is first to appear in serum:", "options": [{"label": "A", "text": "HbsAg", "correct": true}, {"label": "B", "text": "Anti HBs", "correct": false}, {"label": "C", "text": "HbcAg", "correct": false}, {"label": "D", "text": "Anti HBe", "correct": false}], "correct_answer": "A. HbsAg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HbsAg HBsAg (hepatitis B surface antigen) is the first serologic marker to appear in a new acute infection, which can be detected as early as one week and as late as nine weeks, with an average of one month after exposure to the hepatitis B virus (HBV).</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis B surface antigen (HBsAg) is the first serum marker seen in persons with acute infection. It represents the presence of hepatitis B virus (HBV) virions (Dane particles) in the blood. Hepatitis B e antigen (HBeAg), a marker of viral replication, is also present. Most acute HBV infections in adults result in complete recovery with clearance of HBsAg from the blood, production of anti-HBs, and immunity from future disease. Hepatitis B surface antigen (HBsAg) is the first serologic marker appearing in the serum at 6 to 16 weeks following exposure to HBV.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: -</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis B is transmitted when blood, semen, or another body fluid from a person infected with HBV enters the body of someone who is not infected. This can happen through sexual contact; sharing needles, syringes, or other drug-injection equipment; or from mother to baby at birth.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Marker of relative infectivity of serum in Hepatitis B is:", "options": [{"label": "A", "text": "HBsAg", "correct": false}, {"label": "B", "text": "Anti-HBs", "correct": false}, {"label": "C", "text": "HBe Ag", "correct": true}, {"label": "D", "text": "Anti-HBe", "correct": false}], "correct_answer": "C. HBe Ag", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HBe Ag Hepatitis B e-antigen (HBeAg) is a small polypeptide that exists in an accessible form in the serum of individuals during the early phase of hepatitis B infection.</p>\n<p><strong>Highyeild:</strong></p><p>HBeAg is a hepatitis B viral protein. It is an indicator of active viral replication; this means the person infected with Hepatitis B can likely transmit the virus. The e antigen, HBeAg, also produced from the region in and near the core gene, is a marker of active viral replication. Relative predictive factors for hepatocellular carcinoma after HBeAg seroconversion in HBV infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. HBcAb indicates a past or current hepatitis B infection. Option C. HBeAg is an indicator of viral replication Option D. The presence of HBeAb, means there is an active hepatitis B infection, likely in someone with chronic hepatitis B.</p>\n<p><strong>Extraedge:</strong></p><p>The hepatitis E virus is mainly transmitted through drinking water contaminated with faecal matter. Symptoms include jaundice, lack of appetite and nausea. In rare cases, it may progress to acute liver failure. Hepatitis E usually resolves on its own within four to six weeks. Treatment focuses on supportive care, rehydration and rest.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 33-year-old nurse suffered a needle stick injury. The patient used illicit intravenous drugs. One month later, the nurse developed jaundice. Which of the following findings would implicate hepatitis B as the etiology?", "options": [{"label": "A", "text": "Positive anti-hepatitis B surface antibody", "correct": false}, {"label": "B", "text": "Positive anti-hepatitis B-core antibody", "correct": false}, {"label": "C", "text": "Positive hepatitis B surface antigen", "correct": true}, {"label": "D", "text": "Positive anti-hepatitis A antibody", "correct": false}], "correct_answer": "C. Positive hepatitis B surface antigen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Positive hepatitis B surface antigen Hepatitis B infection is caused by the hepatitis B virus (HBV). The virus is passed from person to person through blood, semen, or other body fluids. It does not spread by sneezing or coughing. Hepatitis B virus (HBV) is a Hepadnavirus, highly resistant to extremes of temperature and humidity, that invades the hepatocytes.</p>\n<p><strong>Highyeild:</strong></p><p>A hepatitis B surface antibody test is used to check for immunity to HBV. A positive test means you are immune to hepatitis B. There are two possible reasons for a positive test. You may have been vaccinated or recovered from an acute HBV infection and are no longer contagious. IgM anti-HBc – a positive blood test result indicates a person has a new acute hepatitis B infection. A positive HBsAg test result means you are infected and can spread the hepatitis B virus to others through your blood. anti-HBs or HBsAb (Hepatitis B surface antibody) - A \"positive\" or \"reactive\" anti-HBs (or HBsAb) test result indicates that a person is protected against the hepatitis B virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. The presence of anti-HBs is generally interpreted as indicating recovery and immunity from hepatitis B virus infection. It also develops in a person successfully vaccinated against hepatitis B. Option B. The presence of anti-HBc indicates previous or ongoing infection with the hepatitis B virus in an undefined time frame. Option D. The presence of anti-HAV (IgG or IgM) in human serum or plasma indicates past or present infection with hepatitis A virus (HAV) or vaccination against HAV.</p>\n<p><strong>Extraedge:</strong></p><p>Common symptoms of hepatitis B infection Fever, fatigue, muscle or joint pain. Loss of appetite. Mild nausea and vomiting. Stomach pain. Pale or light colored stools. Dark, tea colored urine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Acute Hepatitis B infection is diagnosed by:", "options": [{"label": "A", "text": "Anti HBc IgG", "correct": false}, {"label": "B", "text": "Anti HBs Ag", "correct": false}, {"label": "C", "text": "Anti HBc IgM", "correct": true}, {"label": "D", "text": "Anti Hbe Ag", "correct": false}], "correct_answer": "C. Anti HBc IgM", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anti HBc IgM Acute hepatitis B is a short-term illness that occurs within the first six months after someone is exposed to the hepatitis B virus. Some people with acute hepatitis B have no symptoms or mild illness. For others, acute hepatitis B causes a more severe disease that requires hospitalization.</p>\n<p><strong>Highyeild:</strong></p><p>Acute HBV infection is characterized by HBsAg and immunoglobulin M (IgM ) antibodies to the core antigen, HBcAg. Acute hepatitis B is a clinical diagnosis identified by detecting HBsAg, symptoms, and high serum aminotransferases. Usually, anti-HBc IgM can be detected, and HBV DNA is present. HBeAg can also be identified in the most acute phase of infections but has little clinical importance.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Marker Clinical significance HBsAg First marker to appear in course of infection Appears one to 3 wk before the onset of symptoms The permanence of this marker for more than 24 wk indicates chronicity Anti-HBc IgM Marker of recent infection marker Appears with the onset of symptoms and persists up to 32 wk after infection Anti-HBc IgG It appears before the onset of symptoms and indicates viral replication independent of disease phase (acute or chronic) This presence indicates high infectivity HBeAg It appears before the onset of symptoms and indicates viral replication independent of disease phase (acute or chronic) This presence indicates high infectivity Anti-HBe It appears after the disappearance of HBeAg Their presence suggests reduction or absence of viral replication, except when infection is due to HBV strains with pre-core mutant (not producing the protein \"e\") Anti-HBs It appears one to 3 mo after HBV vaccination or after recovery of HBV acute infection and indicates immunity to HBV infection</p>\n<p><strong>Extraedge:</strong></p><p>The first phase of disease, during the first 6 months after a person becomes infected, is called acute hepatitis B infection. During this phase, many people show no symptoms at all. Among those who do have symptoms, the illness is usually mild and most people don't recognize that they have liver disease.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A chronic infection of hepatitis B is defined as having demonstrated the presence of:", "options": [{"label": "A", "text": "HBsAg for more than six months", "correct": true}, {"label": "B", "text": "Antibody against HBsAg for more than six months", "correct": false}, {"label": "C", "text": "Antibody against HBcAg for less than six months", "correct": false}, {"label": "D", "text": "HBcAg for more than six months", "correct": false}], "correct_answer": "A. HBsAg for more than six months", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HBsAg for more than six months Hepatitis B infection becomes chronic, meaning it lasts more than six months. Having chronic hepatitis B increases your risk of developing liver failure, liver cancer, or cirrhosis — a condition that permanently scars the liver.</p>\n<p><strong>Highyeild:</strong></p><p>Chronic active hepatitis is a general term embracing any active, progressive liver disease characterized by a marked inflammatory response with concurrent evidence of longstanding disease. People who test positive for the hepatitis B virus for more than six months (after their first blood test result) are diagnosed with a chronic infection. This means their immune system cannot get rid of the hepatitis B virus, and it remains in their blood and liver.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C, and D. A chronic infection of hepatitis B is defined as having demonstrated the presence of HBsAg for more than six months, as explained above; hence all these options are incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>Normal range for hepatitis B Normal range for this assay is \"Not Detected\". The quantitative range of this assay is 1.00-9.00 log IU/mL (10-1,000,000,000 IU/mL). An interpretation of \"Not Detected\" does not rule out the presence of inhibitors in the patient specimen or HBV DNA concentration below the level of detection of the test.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A hospital worker is found to have positive HbsAg & HbeAg. Which of the following best describes the worker?", "options": [{"label": "A", "text": "Is infective and has active hepatitis", "correct": true}, {"label": "B", "text": "Is infective but does not have active hepatitis", "correct": false}, {"label": "C", "text": "Is not infective", "correct": false}, {"label": "D", "text": "Is evincing a biologic false-positive test for hepatitis", "correct": false}], "correct_answer": "A. Is infective and has active hepatitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Is infective and has active hepatitis The association between hepatitis B surface antigen (HBsAg) and hepatitis B 'e' antigen (HBeAg) levels and liver inflammation and fibrosis in patients with chronic hepatitis B (CHB) in the immune clearance (IC) remains elusive.</p>\n<p><strong>Highyeild:</strong></p><p>In HBV carriers and patients with chronic hepatitis B, positive HBeAg results usually indicate active HBV replication and high infectivity. HBeAg is a hepatitis B viral protein. It is an indicator of active viral replication.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C, and D. As the HBsAg & HBeAg are present, the infection is infective and active, as explained above.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "With regards to the newborn child of an HBV positive female, which is false:", "options": [{"label": "A", "text": "Needs HBIG", "correct": false}, {"label": "B", "text": "Needs HBV vaccine at birth", "correct": false}, {"label": "C", "text": "Should not be breastfed.", "correct": true}, {"label": "D", "text": "Has a 90% chance of chronic infection if not treated ASAP.", "correct": false}], "correct_answer": "C. Should not be breastfed.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Should not be breastfed. There is no need to delay breastfeeding until the infant is fully immunized. The risk of HBV mother-to-child transmission through breastfeeding is negligible if infants born to HIV-positive mothers receive the HBIG/HBV vaccine at birth.</p>\n<p><strong>Highyeild:</strong></p><p>There is no evidence that breastfeeding from an HBV-infected mother poses an additional risk of HBV infection to her infant, even without immunization. Thus, even where HBV infection is highly endemic and immunization against HBV is not available, breastfeeding remains the recommended method of infant feeding.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and D. Are correct. Option A and B. Infants born to hepatitis B-positive mothers should receive a hepatitis B vaccine and 0.5 milliliters of hepatitis B immune globulin (HBIG) at separate sites within 12 hours of birth. Option D. Third/Fourth Dose: The vaccination series should be completed at six Without immune prophylaxis, in mothers who are both HBsAg and HBeAg positive, the risk for transmission to the baby is between 70 and 90% by six months. Hepatitis B can be easily passed from a pregnant woman with hepatitis B to her baby at birth. This can happen during a vaginal delivery or a c-section. If you have hepatitis B, healthcare providers can give your baby a set of shots at birth to prevent your baby from getting infected. There is no need to delay breastfeeding until the infant is fully immunized. The risk of HBV mother-to-child transmission through breastfeeding is negligible if infants born to HIV-positive mothers receive the HBIG/HBV vaccine at birth. There is no evidence that breastfeeding from an HBV-infected mother poses an additional risk of HBV infection to her infant, even without immunization. Thus, even where HBV infection is highly endemic and immunization against HBV is not available, breastfeeding remains the recommended method of infant feeding.</p>\n<p><strong>Extraedge:</strong></p><p>Common symptoms of hepatitis B infection Fever, fatigue, muscle or joint pain. Loss of appetite. Mild nausea and vomiting. Stomach pain. Pale or light colored stools. Dark, tea colored urine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The pre-core mutants in hepatitis B are characterized by the notable absence of:", "options": [{"label": "A", "text": "HBV DNA", "correct": false}, {"label": "B", "text": "HBeAg", "correct": true}, {"label": "C", "text": "HBcAg", "correct": false}, {"label": "D", "text": "Anti HBe", "correct": false}], "correct_answer": "B. HBeAg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HBeAg A pre-core mutant is a variety of hepatitis B virus that does not produce hepatitis B virus e antigen (HBeAg). These mutants are essential because infections caused by these viruses are difficult to treat and can cause infections of prolonged duration and with a higher risk of liver cirrhosis.</p>\n<p><strong>Highyeild:</strong></p><p>A pre-core mutant is a variety of hepatitis B viruses that do not produce hepatitis B virus e antigen (HBeAg). These mutants are essential because infections caused by these viruses are difficult to treat and can cause infections of prolonged duration and with a higher risk of liver cirrhosis. The mutations are changes in DNA bases from guanine to adenine at base position 1896 (G1896A) and from cytosine to thymine at position 1858 (C1858T), the pre-core region of the viral genome. The HBV has four genes: S, P, C, and X. The S gene codes for the \"major\" envelope protein (HBsAg). The most significant gene is P. It codes for DNA polymerase.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Precore mutants were related to cases showing negative HBeAg but with detectable HBV-DNA, HBsAg, anti-HBe, and anti-HBc, so option B is correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Best term describing hepatitis B vaccine:", "options": [{"label": "A", "text": "Recombinant DNA vaccine", "correct": true}, {"label": "B", "text": "Edible vaccine", "correct": false}, {"label": "C", "text": "Nuclear transformation", "correct": false}, {"label": "D", "text": "RNA vaccine", "correct": false}], "correct_answer": "A. Recombinant DNA vaccine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Recombinant DNA vaccine The hepatitis B vaccine is a safe and effective vaccine recommended for all infants at birth and children up to 18 years old. The hepatitis B vaccine is also recommended for adults with diabetes and those at high risk for infection due to their jobs, lifestyle, living situations, or country of birth.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis B vaccine prepared from yeast ( Saccharomyces cerevisiae), using recombinant DNA technology. The hepatitis B vaccines are produced with recombinant DNA techniques. They are available both by themselves and in combination with other vaccines. The hepatitis B vaccines are produced with recombinant DNA techniques. They are available both by themselves and in combination with other vaccines.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Vaccine for polio is an edible vaccine. Option C. Hepatitis B is not a nuclear transformation vaccine Option D. Pfizer-BioNTech COVID-19 vaccine is an example of mRNA vaccine</p>\n<p><strong>Extraedge:</strong></p><p>A precore mutant is a variety of hepatitis B virus that does not produce hepatitis B virus e antigen (HBeAg). These mutants are important because infections caused by these viruses are difficult to treat, and can cause infections of prolonged duration and with a higher risk of liver cirrhosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You receive a phone call from a Dermatologist who is seeing a patient with porphyria cutanea tarda. The patient is found to have an elevated serum ALT. Which of the following tests would you recommend the Dermatologist to order?", "options": [{"label": "A", "text": "Anti-HAV IgM", "correct": false}, {"label": "B", "text": "HB surface antigen", "correct": false}, {"label": "C", "text": "Anti-HCV", "correct": true}, {"label": "D", "text": "Anti-HDV", "correct": false}], "correct_answer": "C. Anti-HCV", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anti-HCV Porphyria cutanea tarda (PCT) is a type of porphyria or blood disorder that affects the skin. PCT is one of the most common types of porphyria. It's sometimes referred to colloquially as vampire disease. That's because people with this condition often experience symptoms following exposure to sunlight.</p>\n<p><strong>Highyeild:</strong></p><p>Porphyria cutanea tarda is a condition that affects the liver and skin by reduction and inhibition of uroporphyrinogen decarboxylase enzyme in erythrocytes. Areas of skin exposed to the sun can generate blisters, hyperpigmentation, and, sometimes, lesions that heal, leaving a scar or keratosis. Porphyria cutanea tarda (PCT) is caused by decreased activity, urinary porphyrin excretion, and liver enzyme activities (ALT, AST). Porphyria cutanea tarda, hepatitis C virus antibodies were detected, and other liver or dermatology diseases were tested for anti-HCV.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and C. These tests are not recommended as the patient has porphyria cutanea tarda. As explained above anti-HCV test should be recommended.</p>\n<p><strong>Extraedge:</strong></p><p>Symptoms of end-stage liver disease may include: Easy bleeding or bruising. Persistent or recurring yellowing of your skin and eyes (jaundice) Intense itching. Abdominal pain. Loss of appetite. Nausea. Swelling due to fluid buildup in your abdomen and legs. Problems with concentration and memory.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old male tests positive for a hepatitis C infection. Which of the following is the most likely method of transmission?", "options": [{"label": "A", "text": "Fecal-oral", "correct": false}, {"label": "B", "text": "Fomite", "correct": false}, {"label": "C", "text": "Intravenous drug (needles)", "correct": true}, {"label": "D", "text": "Sexual transmission", "correct": false}], "correct_answer": "C. Intravenous drug (needles)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Intravenous drug (needles) Injection drug users (IDUs) are at risk of hepatitis C virus (HCV) infection due to needle and syringe sharing. Chronic HCV infection is a major cause of liver-related morbidity and mortality but can be cured with antiviral treatment leading to sustained viral response (SVR).</p>\n<p><strong>Highyeild:</strong></p><p>Intravenous drug use (IVDU) remains a primary means of hepatitis C virus (HCV) transmission. Without PEP, the estimated seroconversion rate after exposure to a known HBV-positive source is 6% to 30%. Hepatitis C virus (HCV): After a needlestick injury from a known positive HCV patient source, the risk of seroconversion is approximately 1.8%.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and D. Are not the most likely method of transmission</p>\n<p><strong>Extraedge:</strong></p><p>While hepatitis C tends to get more attention and research funding, hepatitis B is considerably more common and causes more liver-related cancer and death worldwide than hepatitis C. Combined, chronic hepatitis B and C account for approximately 80% of the world's liver cancer cases</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is a defective virus?", "options": [{"label": "A", "text": "Hepatitis A", "correct": false}, {"label": "B", "text": "Hepatitis B", "correct": false}, {"label": "C", "text": "Hepatitis C", "correct": false}, {"label": "D", "text": "Hepatitis D", "correct": true}], "correct_answer": "D. Hepatitis D", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hepatitis D Hepatitis D virus, also known as hepatitis delta virus, is a defective virus that is closely associated with HBV. Although HDV can replicate autonomously, it requires the presence of HBV for virion assembly and secretion; thus, all patients with HDV are coinfected with HBV.</p>\n<p><strong>Highyeild:</strong></p><p>HDV is highly pathogenic, and its infection aggravates the underlying HBV infection upon which it thrives. Hepatitis D infection cannot occur in the absence of hepatitis B virus. HDV-HBV co-infection is considered the most severe form of chronic viral infection. Replication defective viruses (also known as satellites) are Hepatitis D, also referred to as hepatitis D virus (HDV) and classified as a defective virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and C. Hepatitis A, Hepatitis B, and Hepatitis C are not defective viruses.</p>\n<p><strong>Extraedge:</strong></p><p>While hepatitis C tends to get more attention and research funding, hepatitis B is considerably more common and causes more liver-related cancer and death worldwide than hepatitis C. Combined, chronic hepatitis B and C account for approximately 80% of the world's liver cancer cases</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "HDV is a defective virus that requires its helper to provide:", "options": [{"label": "A", "text": "An envelope protein", "correct": false}, {"label": "B", "text": "Transcriptase to transcribe mRNA", "correct": false}, {"label": "C", "text": "Replicase for its RNA", "correct": false}, {"label": "D", "text": "Reverse transcriptase", "correct": true}], "correct_answer": "D. Reverse transcriptase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Reverse transcriptase Hepatitis D virus, or hepatitis delta virus, is a defective virus closely associated with HBV. Although HDV can replicate autonomously, it requires the presence of HBV for virion assembly and secretion; thus, all patients with HDV are coinfected with HBV.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatitis D virus (HDV) is a defective RNA virus that requires help. Since HDV requires the envelope proteins of HBV (HBsAg) for its assembly and release, a productive HDV infection, leading to the release of progeny viruses, exclusively occurs in the presence of HBV. It is thus plausible that both viruses have to interact with each other at different stages of their replication cycles.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, And C. The hepatitis delta viruses, or HDV, are eight species of negative-sense single-stranded RNA viruses (or virus-like particles) classified together as the genus Deltavirus within the realm Ribozyyria The HDV virion is a small, spherical, enveloped particle with a 36 nm diameter; its viral envelope contains host phospholipids, as well as three proteins were taken from the hepatitis B virus—the large, medium, and small hepatitis B surface antigens. This assembly surrounds an inner ribonucleoprotein (RNP) particle, which contains the genome surrounded by about 200 molecules of hepatitis D antigen (HDAg) for each genome. The central region of HDAg has been shown to bind RNA. Several interactions are also mediated by a coiled-coil region at the H. terminus of HDAg.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis D only occurs in people who are also infected with the hepatitis B virus. Hepatitis D is spread when blood or other body fluids from a person infected with the virus enters the body of someone who is not infected. Hepatitis D can be an acute, short-term infection or become a long-term, chronic infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All true about hepatitis except:", "options": [{"label": "A", "text": "HAV and HEV Hepatitis E Virus are transmitted feco-orally", "correct": false}, {"label": "B", "text": "An effective killed vaccine is available for HCV", "correct": true}, {"label": "C", "text": "HAV produces acute but not chronic hepatitis", "correct": false}, {"label": "D", "text": "HDV can only affect persons co-infected with hepatitis B.", "correct": false}], "correct_answer": "B. An effective killed vaccine is available for HCV", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>An effective killed vaccine is available for HCV A hepatitis C vaccine, capable of protecting against the hepatitis C virus (HCV), is not yet available. Although vaccines exist for hepatitis A and hepatitis B, developing an HCV vaccine has presented challenges. No vaccine is available, but several vaccines are under development.</p>\n<p><strong>Highyeild:</strong></p><p>There is currently no effective vaccine against hepatitis C. Among the difficulties that have hampered the development of a vaccine against HCV there is its extreme genetic variability (main reason), the lack of small animal models for testing vaccines, and the fact that a cell culture system supporting the production of infectious HCV and allowing studies on virus neutralization in vitro became available only recently.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options: - Option A, C, and D. Are true.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis D only occurs in people who are also infected with the hepatitis B virus. Hepatitis D is spread when blood or other body fluids from a person infected with the virus enters the body of someone who is not infected. Hepatitis D can be an acute, short-term infection or become a long-term, chronic infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Most severe infections in HAV are seen in:", "options": [{"label": "A", "text": "Infants", "correct": false}, {"label": "B", "text": "Children", "correct": false}, {"label": "C", "text": "Adults", "correct": true}, {"label": "D", "text": "Pregnant", "correct": false}], "correct_answer": "C. Adults", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Adults Most adults with HAV Hepatitis A virus infection have a symptomatic illness that begins with abrupt onset of nausea, anorexia, fever, malaise, and abdominal pain. Within a few days to a week, dark urine and acholic stools appear, followed by jaundice and pruritus. Adults are more likely to have symptoms than children.</p>\n<p><strong>Highyeild:</strong></p><p>Symptoms of hepatitis A range from mild to severe and can include fever, malaise, loss of appetite, diarrhea, nausea, abdominal discomfort, dark-colored urine, and jaundice (a yellowing of the skin and whites of the eyes). Not everyone who is infected will have all of the symptoms. Hepatitis A infection results in a severe illness that lasts several months.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A & B. Infection is less severe, and symptoms are less likely. Option D. Infection is less severe or asymptomatic</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis A is preventable by vaccine. It spreads from contaminated food or water or contact with someone who is infected. Symptoms include fatigue, nausea, abdominal pain, loss of appetite and low-grade fever. The condition clears up on its own in one or two months. Rest and adequate hydration can help.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Your patient developed clinical symptoms of hepatitis after visiting several Asian countries like Bangladesh and Myanmar. Likely cause:", "options": [{"label": "A", "text": "HBV Hepatitis B Virus", "correct": false}, {"label": "B", "text": "HCV Hepatitis C Virus", "correct": false}, {"label": "C", "text": "HDV Hepatitis D Virus", "correct": false}, {"label": "D", "text": "HEV Hepatitis E Virus", "correct": true}], "correct_answer": "D. HEV Hepatitis E Virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HEV Hepatitis E Virus Hepatitis E is a liver disease caused by the infection known as hepatitis E virus (HEV). Every year, there are an estimated 20 million HEV infections worldwide, leading to an estimated 3.3 million symptomatic cases of hepatitis E. The virus has been mainly associated with the consumption of raw or undercooked pork meat or offal but also with wild boar meat, venison, and shellfish. The study confirms that HEV infections occur throughout the year and is a major (34%) cause of acute jaundice in tertiary hospitals in Bangladesh. Three-quarters of the acute hepatitis E cases were male, and HEV infection was higher among patients residing in urban areas than in rural areas. HEV, previously called enterically transmitted non-A, non-B hepatitis, is a major cause of epidemic hepatitis and acute, sporadic hepatitis in developing countries.</p>\n<p><strong>Highyeild:</strong></p><p>The hepatitis E virus is mainly transmitted through drinking water contaminated with fecal matter. Symptoms include jaundice, lack of appetite, and nausea. In rare cases, it may progress to acute liver failure. Hepatitis E usually resolves on its own within four to six weeks. Treatment focuses on supportive care, rehydration, and rest.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A, B, and C. Due to the patient’s travel history to Bangladesh and Myanmar, HEV infection is more likely than any other.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis B is a vaccine-preventable liver infection caused by the hepatitis B virus (HBV). Hepatitis B is spread when blood, semen, or other body fluids from a person infected with the virus enters the body of someone who is not infected.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 28-year-old man presented with severe acute pain in the right upper abdomen which was associated with bilious vomiting and high-grade fever. He had jaundice a few days back which resolved spontaneously. He was not having constipation, obstipation, or diarrhea. On clinical examination, he was febrile (101 °F), icteric, and well-hydrated. His per-abdomen examination was normal except for tender hepatomegaly. His laboratory parameters were Hb 10.4 g%, TLC 12,300/cc, and serum bilirubin 6.98 mg/dl (direct 6.42 mg/dl). His transaminases were mildly elevated and serum alkaline phosphatase was normal. He had a normal serum amylase level and coagulation profile. His X-ray abdomen did show dilated bowel loops with multiple air-fluid levels observed. He has a history of prior laparotomy and the imaging findings, an adhesive small bowel obstruction was thought to be the etiology, and he was brought to the operating theatre for exploratory laparotomy. Photograph of a segment of resected ileum with adult worms retrieved from the lumen. The specimen was also sent for ova and parasite examination. Which of the following organisms is responsible for the patient's condition", "options": [{"label": "A", "text": "Ascaris lumbricoides", "correct": true}, {"label": "B", "text": "Enterobius vermicularis", "correct": false}, {"label": "C", "text": "Trichuris trichiura", "correct": false}, {"label": "D", "text": "Wuchereria bancrofti", "correct": false}], "correct_answer": "A. Ascaris lumbricoides", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506590141-QTDV019001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ascaris lumbricoides Clinical features given are suggestive of intestinal obstruction (multiple air-fluid levels) and biliary obstruction (icterus and elevated transaminases).it is due to mechanical obstruction by adult worms in the intestinal tract and biliary tract respectively . Adult worms of Ascaris are known for causing mechanical obstruction in the respiratory or intestinal or biliary tract. Ascaris lumbricoides is an intestinal nematode (small intestine) also known as roundworm (shown in image A) and image B shows the magnified gross morphology of the anterior part of the roundworm. Image C shows fertilized ova of roundworm in the small intestine</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. vermicularis causes appendicitis and perianal pruritis. Option C. Trichuris Trichiura causes rectal prolapse and chronic dysentery leading to iron deficiency anemia. Option D. bancrofti is a non-intestinal nematode that does not cause intestinal obstruction.</p>\n<p><strong>Extraedge:</strong></p><p>Ascaris lumbricoides , a roundworm, infects humans via the fecal-oral route. Eggs released by adult females are shed in feces. Unfertilized eggs are often observed in fecal samples but never become infective. Fertilized eggs embryonate and become infectious after 18 days to several weeks in soil, depending on the environmental conditions (optimum: moist, warm, shaded soil).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old female patient in her 35th week of gestation presented to the medical outpatient department with complaints of loose stools not associated with blood, with a frequency of 10 times a day for the past two days. The patient gave a history of two episodes of vomiting and pain in the abdomen. There was no history of fever, rash, burning micturition, white discharge, and vaginal bleeding. The first and second trimesters were uneventful. The patient gave a history of appendectomy five years back. General physical examination was normal. A complete blood picture revealed mild anemia (hemoglobin: 9.5 g%) and there was no eosinophilia. Ultrasound revealed a single live intrauterine fetus (SLIUF) in cephalic presentation with a mean gestational age of 35 to 36 weeks and mild polyhydramnios. Stool examination for intestinal parasites and for the presence of occult blood was advised. Direct stool examination using a simple wet mount with saline and iodine mount revealed the following findings. Which of the following is a causative organism for patient condition", "options": [{"label": "A", "text": "Hymenolepis Nana", "correct": true}, {"label": "B", "text": "Diphyllobothrium latum", "correct": false}, {"label": "C", "text": "Schistosoma haematobium", "correct": false}, {"label": "D", "text": "Entrobius vermicularis", "correct": false}], "correct_answer": "A. Hymenolepis Nana", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506597135-QTDV019002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis Nana Eggs of hymenolepis nana are characterized by three pairs of hooklets, polar filaments, and polar thickenings. It causes abdominal pain and diarrhea.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Diphyllobothrium latum lays operculated eggs. Option C. Schistosoma haematobium has miracidium inside the egg and a terminal spine. Option D. Enterobius vermicularis for pinworm eggs have Plano convex shape tadpole larva inside.</p>\n<p><strong>Extraedge:</strong></p><p>The infective eggs develop into cysticercoids that can be ingested by humans or rodents, releasing oncospheres that then penetrate the intestine and develop into cysticercoid larvae. These larvae can then attach to the intestinal mucosa and develop into adults.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 7-year-old boy presented with lower abdominal pain and chronic diarrhea. On examination signs of protein energy malnutrition are present. A routine stool examination for parasites is ordered. Bile-stained eggs of which of the following organisms can be suspected in the stool sample of the patient?", "options": [{"label": "A", "text": "Nectar Americans", "correct": false}, {"label": "B", "text": "Ancylostoma duodenale", "correct": false}, {"label": "C", "text": "Hymenolepis Nana", "correct": false}, {"label": "D", "text": "Ascaris lumbricoides", "correct": true}], "correct_answer": "D. Ascaris lumbricoides", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ascaris lumbricoides Eggs of Ascaris lumbricoides are Bile stained.</p>\n<p><strong>Highyeild:</strong></p><p>Helminths that lay non-bile-stained eggs are N-nectar Americans(option A) E-ENTEROBIUS H-hymenolepis(option C) A-Ancylostoma All the others will lay bile-stained eggs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Nectar Americans, Ancylostoma, E-ENTEROBIUS & Hymenolepis Nana lays non-bile-stained eggs</p>\n<p><strong>Extraedge:</strong></p><p>Fertile eggs range from 45 to 75 µm in length. Unfertilized eggs are elongated and larger than fertile eggs (up to 90 µm in length). Their shell is thinner and their mammillated layer is more variable, either with large protuberances or practically none.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 45-year-old male presented to OPD with complaints of abdominal pain, loss of appetite, diarrhea, and fatigue. On general examination there are signs of nutritional deficiency and blood examination revealed iron deficiency anemia. Physician suspects hookworm infection. What is most likely the route of entry of the infective larvae?", "options": [{"label": "A", "text": "Inhalation", "correct": false}, {"label": "B", "text": "Inoculation", "correct": false}, {"label": "C", "text": "Penetration of skin", "correct": true}, {"label": "D", "text": "Ingestion", "correct": false}], "correct_answer": "C. Penetration of skin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Penetration of skin Filariform Lava enters the human body by penetrating the skin Ancylostoma or hookworm causes iron deficiency anemia in humans</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. Filaria form larvae of hookworm enter through penetrating skin but not by ingestion, inhalation, or inoculation</p>\n<p><strong>Extraedge:</strong></p><p>The eggs of Ancylostoma and Necator cannot be differentiated microscopically. The eggs are thin-shelled, colorless and measure 60-75 µm by 35-40 µm. Figure A: Hookworm egg in an unstained wet mount, taken at 400x magnification.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 21-year-old male presented with abdominal pain diarrhea weakness and fatigue for one week. The patient also shows signs of nutritional deficiencies. The blood examination reveals an increased eosinophil count. The physician suspects parasitic infection in the patient. Which of the following organism is not associated with causing autoinfection?", "options": [{"label": "A", "text": "Taenia solium", "correct": false}, {"label": "B", "text": "Hymenolepis nana", "correct": false}, {"label": "C", "text": "Enterobius vermicularis", "correct": false}, {"label": "D", "text": "Echinococcus granulosis", "correct": true}], "correct_answer": "D. Echinococcus granulosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Echinococcus granulosis Echinococcus granulosus (dog tapeworm) is not associated with any auto infections. It causes hydatid cyst.</p>\n<p><strong>Highyeild:</strong></p><p>Autoinfection is seen with H-Hymenolepis E-ENTEROBIUS S-Strongoiloides T-Taenia sodium</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C. Autoinfection is seen with H-Hymenolepis E-ENTEROBIUS S-Strongoiloides T-Taenia sodium</p>\n<p><strong>Extraedge:</strong></p><p>The types of infection Infection from environment Autoinfection: Female crawl out of anus and release eggs on the perianal region. Patients feel anus pruritus. Scratching leads to contamination of hands and nails. Then by hand-mouth result in reinfection. Retroinfection: Some eggs hatch on the perianal skin and become larvae. They will crawlback into the anus and mature into adults.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 56-year-old man visited the hospital having passed proglottids in his stool for the past two months and brought a stool sample with proglottids segments to our hospital. He had no abdominal symptoms, such as nausea, vomiting, abdominal pain, diarrhea, or constipation. He used to consume raw beef and fish frequently. To identify the tapeworm species, we carried out molecular analyses on the proglottids. Which of the following tapeworm species do not have an intermediate host?", "options": [{"label": "A", "text": "Taenia solium", "correct": false}, {"label": "B", "text": "Hymenolepis nana", "correct": true}, {"label": "C", "text": "Echinococcus granulosus", "correct": false}, {"label": "D", "text": "Taenia saginata", "correct": false}], "correct_answer": "B. Hymenolepis nana", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis nana Hymenolepis Nana does not have any intermediate host.</p>\n<p><strong>Highyeild:</strong></p><p>Hymenolepis nana is unique among tapeworms in that the adult worm develops after the egg is ingested. The hooked oncosphere then invades the intestinal mucosa and develops into a cysticeroid larva. Hymenolepis nana eggs can contaminate hands, be trapped in particulate matter , or be aerosolized, and then accidentally ingested.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Pig is the intermediate host of taenia solium. Option C. Humans are intermediate host for Echinococcus granulosus. Option D. Cow is an intermediate host for taenia saginata.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 40-year-old lady presented to the Medicine OPD with a history of pain abdomen and the passage of cream-colored tape-like structures in her stool for two months. She also gave on and off a history of diarrhea and easily fatigability. She was a non-vegetarian and an occasional fish eater. During the diarrheic episodes, her stools were semisolid in consistency and contained no blood or mucus. No similar complaints were present in her family. The blood picture revealed hemoglobin of 9.7 g/dL and a total count of 8500/mm3. Differential counts were within normal limits except for eosinophil slightly raised (9%). The peripheral blood smear showed hyper-segmented neutrophils suggesting the following findings. which of the organism is most probably associated with patients’ medical conditions.", "options": [{"label": "A", "text": "Ancylostoma duodenale", "correct": false}, {"label": "B", "text": "Necator Americana", "correct": false}, {"label": "C", "text": "Diphyllobothrium latum", "correct": true}, {"label": "D", "text": "Trichuris trichura", "correct": false}], "correct_answer": "C. Diphyllobothrium latum", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506598794-QTDV019008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diphyllobothrium latum The peripheral blood smear in the above picture is suggestive of megaloblastic anemia (Macrocytes &. Multi lobular polymorph Neutrophils). Diphyllobothrium latum is the helminth associated with Megaloblastic anemia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. Ancylostoma duodenale, Necator Americans & Trichuris trichura are associated with iron deficiency anemia (microcytic & Hypochromic). But in the above picture, megaloblastic anemia can be seen very clearly and hence incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>Egg of D.latum Pale yellow and ovale in shape Measuring about 70-45 Has an operculum(lid) Contains amass of granulated yolk cells surrounding an undeveloped ovum Small projection is seen at the non-operculated end of the egg.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The clinical picture depicted in the image below is caused by a Helminth which has its intermediate host as", "options": [{"label": "A", "text": "Cyclops", "correct": true}, {"label": "B", "text": "Fish", "correct": false}, {"label": "C", "text": "Snail", "correct": false}, {"label": "D", "text": "Aquatic plants", "correct": false}], "correct_answer": "A. Cyclops", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506599984-QTDV019009IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cyclops The given image demonstrates the helminth worm with the help of a matchstick. Is characteristic of Dracunculus medinensis (Guinea worm). Cyclops is the intermediate host for Dracunculus medinensis (Guinea worm) & sometimes for fish tapeworm (Diphyllobothrium latum).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Fish is the second intermediate host for Paragonus Westermani. Option C. Snail is the intermediate host for trematodes (flukes). Option D. aquatic plants are the second intermediate host for Fasciola hepatica & Fasciola Buski.)</p>\n<p><strong>Extraedge:</strong></p><p>TREATMENT REMOVAL OF WORM BY TWISTING IT AROUND TAKE WEEKS TO MONTHS METRONIDAZOLE, NIRIDAZOLE, MEMBEN SURGICAL REMOVAL OF WORM</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A person presents to his physician complaining of chronic GI symptoms. A diagnosis of Ascaris lumbricoides was made. Human nematodes infect individuals via different routes. This patient was most likely infected by which of the following?", "options": [{"label": "A", "text": "Larvae penetrating unprotected skin", "correct": false}, {"label": "B", "text": "Ingesting larvated eggs", "correct": true}, {"label": "C", "text": "Eating uncooked pork", "correct": false}, {"label": "D", "text": "Internal autoinfection", "correct": false}], "correct_answer": "B. Ingesting larvated eggs", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ingesting larvated eggs The human and porcine hosts become infected by ingesting larvated Ascaris eggs from the environment (e.g. in contaminated water or food); third-stage larvae hatch from the eggs migrate through the intestinal wall into the bloodstream, and then through the liver and to the lungs.</p>\n<p><strong>Highyeild:</strong></p><p>Ascariasis is caused by ingesting eggs. This can happen when hands or fingers that have contaminated dirt on them are put in the mouth, or by consuming vegetables or fruits that have not been carefully cooked, washed, or peeled. People infected with Ascaris often show no symptoms.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. These are not the routes for transmission of Ascaris lumbricoides. Ascariasis is caused by ingesting eggs. This can happen when hands or fingers that have contaminated dirt on them are put in the mouth, or by consuming vegetables or fruits that have not been carefully cooked, washed, or peeled.</p>\n<p><strong>Extraedge:</strong></p><p>Laboratory Diagnosis Macroscopic identification Of adults passed in stool or through the mouth or nose Larval worms Detection in sputum Stool Microscopy Eggs may be identified on direct stool examination Eosinophilia Eosinophilia can be found. particularly during larval migration through the lungs</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Consumption of uncooked pork is likely to cause which of the following helminthic disease:", "options": [{"label": "A", "text": "Tinea saginata", "correct": false}, {"label": "B", "text": "T. spiralis", "correct": true}, {"label": "C", "text": "Hydatid cyst", "correct": false}, {"label": "D", "text": "Trichuris trichiura", "correct": false}], "correct_answer": "B. T. spiralis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>T. spiralis Trichinella spiralis is a viviparous nematode parasite, occurring in rodents, pigs, bears, hyenas, and humans, and is responsible for the disease trichinosis. It is sometimes referred to as the \"pork worm\" due to it being typically encountered in undercooked pork products.</p>\n<p><strong>Highyeild:</strong></p><p>Trichinella spiralis is a viviparous nematode parasite, occurring in rodents, pigs, bears, hyenas, and humans. Trichinellosis (trichinosis) is caused by nematodes (roundworms) of the genus Trichinella. Trichinosis is caused by eating raw or undercooked pork and wild game. The contaminated meat is infected with the larvae of a worm called Trichinella spiralis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. saginata is transmitted from eating “measly beef” Option C. Humans acquire hydatid cysts by ingesting Echinococcus eggs from dog feces after handling or caring for dogs. Option D. The trichuriasis eggs become infective after 3 weeks of incubation in moist and shady soil, humans acquire the infection after eating foods contaminated with infective eggs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Infection with colitis is caused by:", "options": [{"label": "A", "text": "Enterobius vermicularis", "correct": false}, {"label": "B", "text": "Trichuris trichiura", "correct": true}, {"label": "C", "text": "Strongyloides", "correct": false}, {"label": "D", "text": "Clonorchis", "correct": false}], "correct_answer": "B. Trichuris trichiura", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichuris trichiura Trichuris trichiura, Trichocephalus trichiasis or whipworm, is a parasitic roundworm that causes trichuriasis when it infects a human large intestine. It is commonly known as the whipworm which refers to the shape of the worm; it looks like a whip with wider \"handles\" at the posterior end.</p>\n<p><strong>Highyeild:</strong></p><p>Globally, Trichuris trichiura, or whipworm, is a very common intestinal helminthic infection. Mature whipworms attach themselves to the epithelial surface causing inflammation and colitis which, in serious infections, can affect the entire colon and rectum. Adult Trichuris trichiura worms in the hemorrhagic colon mucosa. The majority of individuals are infected with T.trichura.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Site of infection for E. vermicularis lumen of cecum and colon but does not cause colitis Option C. Site of infection for Strongyloides is the small intestine Option D. Site of infection for Clonorchis is the Liver (bile ducts)</p>\n<p><strong>Extraedge:</strong></p><p>Trichuris trichiura eggs are 50-55 micrometers by 20-25 micrometers. They are barrel-shaped, thick-shelled and possess a pair of polar “plugs” at each end. The eggs are unembryonated when passed in stool.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is a common soil-transmitted helminthic infection in India characterized by eggs in the stool shown in the image below", "options": [{"label": "A", "text": "Trichuris", "correct": true}, {"label": "B", "text": "Ascaris", "correct": false}, {"label": "C", "text": "Enterobius", "correct": false}, {"label": "D", "text": "Ancylostoma duodenale", "correct": false}], "correct_answer": "A. Trichuris", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506601560-QTDV019014IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichuris Trichuris trichiura, Trichocephalus Trichuris, or whipworm, is a parasitic roundworm that causes trichuriasis when it infects a human large intestine. It is commonly known as the whipworm which refers to the shape of the worm; it looks like a whip with wider \"handles\" at the posterior end. This is the classical appearance of the Trichuria (whipworm) egg. The eggs are highly infectious.</p>\n<p><strong>Highyeild:</strong></p><p>A whipworm infection is caused by a parasite called Trichuris trichiura. Whipworm eggs can get into the soil when contaminated with feces. The most common cause of trichuriasis is the ingestion of infected eggs that are found in soil. This is often due to poor sanitary conditions. Trichuris trichiura eggs are 50-55 micrometers by 20-25 micrometers. They are barrel-shaped, thick-shelled, and possess a pair of polar “plugs” at each end. The eggs are unembryonated when passed in the stool.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Ascaris is acquired by ingestion of eggs from faecally contaminated soil or food but they are larger than the image above Option C. Enterobius infection is transmitted by the fecal-oral route (by the transfer of pinworm eggs from the anus to someone’s mouth) Option D. Ancylostoma infection is transmitted by walking barefoot on soil, but the eggs are bigger thin-shelled, and colorless as compared to the image given above</p>\n<p><strong>Extraedge:</strong></p><p>After 14 to 21 days, the eggs mature and enter an infective stage. If humans ingest the embryonated eggs, the eggs start to hatch in the human small intestine and utilize the intestinal microflora and nutrients to multiply and grow.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In which of the following life cycle stages is enterobiasis transmitted?", "options": [{"label": "A", "text": "Larva", "correct": false}, {"label": "B", "text": "Egg", "correct": true}, {"label": "C", "text": "Adult", "correct": false}, {"label": "D", "text": "Cyst", "correct": false}], "correct_answer": "B. Egg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Egg The egg stage is the stage transmitted from person to person.</p>\n<p><strong>Highyeild:</strong></p><p>EGG: Colourless, non-bile stained Shape: Planoconvex Shell Double layered Transparent Sticky outer albuminous layer o Contains tadpole shaped', coiled larva Viable up to 2 weeks</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. A larval form is found inside the egg but does not escape to initiate infection until the egg is ingested. Option C. Adult forms live in the intestine but are not the stage directly responsible for the transmission of the infection. Option D. Cysts are seen in protozoal parasites.</p>\n<p><strong>Extraedge:</strong></p><p>The eggs of Enterobius vermicularis measure 50—60 µm by 20—30 µm. They are transparent, elongate to oval in shape, and slightly flattened on one side. They are usually partially embryonated when shed.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the drug of choice in treating enterobiasis?", "options": [{"label": "A", "text": "Mebendazole", "correct": true}, {"label": "B", "text": "Metronidazole", "correct": false}, {"label": "C", "text": "Piperazine", "correct": false}, {"label": "D", "text": "Praziquantel", "correct": false}], "correct_answer": "A. Mebendazole", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mebendazole Mebendazole is the most appropriate of several available benzimidazole compounds to treat enterobiasis. This drug of choice is a highly effective, broad-spectrum antihelminthic.</p>\n<p><strong>Highyeild:</strong></p><p>Drugs for Nematodes Benzimidazoles Mebendazole Thiabendazole Albendazole Pyrantel pamoate Ivermectin Diethylcarbamazine</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Metronidazole is used mainly for intestinal/genitourinary protozoal parasitic infections and anaerobic bacterial infections. Option C. Piperazine is also used for the treatment of roundworm infections. Option D. Praziquantel is DOC for most cestode and trematode infections.</p>\n<p><strong>Extraedge:</strong></p><p>People become infected, usually unknowingly, by swallowing (ingesting) infective pinworm eggs that are on fingers, under fingernails, or on clothing, bedding, and other contaminated objects and surfaces. Because of their small size, pinworm eggs sometimes can become airborne and ingested while breathing.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 24 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "All of the following statements are true except?", "options": [{"label": "A", "text": "Chronic infection of Fasciola hepatica can cause hepatocellular carcinoma", "correct": true}, {"label": "B", "text": "Paragonimus westermani infection causes endemic hemoptysis", "correct": false}, {"label": "C", "text": "Schistosoma is a trematode that lays nonoperculated eggs", "correct": false}, {"label": "D", "text": "Schistosoma has only one intermediate host, unlike other trematodes", "correct": false}], "correct_answer": "A. Chronic infection of Fasciola hepatica can cause hepatocellular carcinoma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chronic infection of Fasciola hepatica can cause hepatocellular carcinoma Fasciola hepatica is a liver fluke that can cause cholecystitis and cholangitis. It is not associated with hepatocellular carcinoma. Clonorchis sinensis is an inhabitant of the bile duct & is associated with Cholangiocarcinoma.</p>\n<p><strong>Highyeild:</strong></p><p>Immature eggs are discharged in the biliary ducts and passed in the stool. Eggs become embryonated in freshwater over ~2 weeks; Embryonated eggs release miracidia, which invade a suitable snail intermediate host. In the snail, the parasites undergo several developmental stages (sporocysts, rediae, and cercariae). The cercariae are released from the snail and encyst as metacercariae on aquatic vegetation or other substrates. Humans and other mammals become infected by ingesting metacercariae-contaminated greenery (e.g., watercress). After ingestion, the metacercariae exocyst in the duodenum penetrates through the intestinal wall into the peritoneal cavity. The immature flukes then migrate through the liver parenchyma into biliary ducts, where they mature into adult flukes and produce eggs. In humans, maturation from metacercariae into adult flukes usually takes about 3–4 months; the development of F. gigantica may take longer than F. hepatica .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. paragonimus westermani infection presences endemic hemoptysis. Option: C. Schistosoma is a trematode that lays nonoperculated eggs. Option: D. Schistosoma has only one intermediate host, unlike other trematodes & it is diecious unlike other trematodes, which are monoecious</p>\n<p><strong>Extraedge:</strong></p><p>The standard way to be sure a person is infected with Fasciola is by seeing the parasite. This is usually done by finding Fasciola eggs in stool (fecal) specimens examined under a microscope. More than one specimen may need to be examined to find the parasite.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the correct pair regarding trematodes: I) Schistosoma-blood fluke-snail (intermediate host) II) Paragonimus westermani-intestinal fluke-snail & fish (intermediate host) III) Fasciola hepatica-liver fluke-snail & aquatic plants (intermediate host) IV) Fasciola buski-lung fluke-snail & aquatic plants (intermediate host) Select the correct option from the given below code:", "options": [{"label": "A", "text": "Only II, IV", "correct": false}, {"label": "B", "text": "Only I, III", "correct": true}, {"label": "C", "text": "Only I, II, and III", "correct": false}, {"label": "D", "text": "All are correct", "correct": false}], "correct_answer": "B. Only I, III", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Only I, III Schistosoma is a blood fluke with a snail as an intermediate host. Fasciola hepatica is a liver fluke with snails and aquatic plants as intermediate hosts. Fasciola buski is an intestinal fluke with snails and aquatic plants as the intermediate host.</p>\n<p><strong>Highyeild:</strong></p><p>The parasites that cause schistosomiasis live in certain types of freshwater snails. The infectious form of the parasite, known as cercariae, emerges from the snail into the water. You can become infected when your skin comes in contact with contaminated freshwater. Most human infections are caused by Schistosoma mansoni, S. haematobium , or S. japonicum .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Paragonimus westermani is a lung fluke with snails and fish as an intermediate hosts. Option: D. Facial hepatica is a liver fluke with snails and aquatic plants as intermediate hosts.</p>\n<p><strong>Extraedge:</strong></p><p>Schistosomiasis, also known as bilharzia or snail fever, is an acute and chronic disease caused by parasitic flatworms called schistosomes or blood flukes. Most human infections are caused by Schistosoma mansoni, S. haematobium, or S. japonicum.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A traveler presents with conjugated hyperbilirubinemia. On investigations, an egg was found in his biliary tract. The likely organism is:", "options": [{"label": "A", "text": "Clonorchis sinensis", "correct": true}, {"label": "B", "text": "Fasciola busk", "correct": false}, {"label": "C", "text": "Gnathostomata", "correct": false}, {"label": "D", "text": "Ascaris", "correct": false}], "correct_answer": "A. Clonorchis sinensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clonorchis sinensis Clonorchis sinensis eggs. Clonorchis sinensis eggs are small. The eggs are oval-shaped with a convex operculum that rests on visible “shoulders” at the smaller end of the egg. At the opposite (opercular) lot, a small knob or hook-like protrusion is often visible.</p>\n<p><strong>Highyeild:</strong></p><p>The eggs of a C. sinensis are released through the biliary tract and excreted out along with the feces. The eggs are embryonated and contain the larvae called miracidia. Unlike most other flukes in which the miracidia undergo development and swim in the water to infect a suitable host, the eggs of C. Sinensis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. The mammalian hosts become infected by ingesting metacercariae from the aquatic plants. After ingestion, the metacercariae exocyst in the duodenum attaches to the intestinal wall. Option: C. Humans are accidental hosts; the only forms found in humans are larvae or immature adults that never reach reproductive maturity. Option: D. Adult worms live in the lumen of the small intestine. A female may produce approximately 200,000 eggs per day, passed with feces. Unfertilized eggs may be ingested but are not infective. Larvae develop infectivity within fertile eggs after 18 days to several weeks, depending on the environmental conditions (optimum: moist, warm, shaded soil). After infective eggs are swallowed, the larvae hatch, invade the intestinal mucosa, and are carried via the portal, then systemic circulation to the lungs. The larvae mature further in the lungs (10 to 14 days), penetrate the alveolar walls, ascend the bronchial tree to the throat, and are swallowed. Upon reaching the small intestine, they develop into adult worms. Between 2 and 3 months are required from ingesting the infective eggs to oviposition by the adult female. Adult worms can live 1 to 2 years</p>\n<p><strong>Extraedge:</strong></p><p>Clonorchis is a liver fluke parasite that humans can get by eating raw or undercooked fish from areas where the parasite is found. Found across parts of Asia, Clonorchis is also known as the Chinese or oriental liver fluke. Liver flukes infect the liver, gallbladder, and bile duct in humans</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Liver is the primary target in-", "options": [{"label": "A", "text": "Clonorchis sinensis", "correct": true}, {"label": "B", "text": "Fasciolopsis buski", "correct": false}, {"label": "C", "text": "Ascaris lumbricoides", "correct": false}, {"label": "D", "text": "Schistosoma mansoni", "correct": false}], "correct_answer": "A. Clonorchis sinensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clonorchis sinensis Clonorchis sinensis, the Chinese liver fluke, belongs to the class Trematoda, phylum Platyhelminthes. It infects fish-eating mammals, including humans. Clonorchiasis is an infectious disease caused by the Chinese liver fluke, Clonorchis sinensis, and two related species.</p>\n<p><strong>Highyeild:</strong></p><p>Clonorchiasis is a known risk factor for developing cholangiocarcinoma, a neoplasm of the biliary system. Clonorchis is a liver fluke parasite that humans can get by eating raw or undercooked fish, crabs, or crayfish from areas where the parasite is found. Found across parts of Asia, Clonorchis is also known as the Chinese or oriental liver fluke. Liver flukes infect the liver, gallbladder, and bile duct in humans.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Fasciolopsis buski - Giant intestinal fluke. The mammalian hosts become infected by ingesting metacercariae from the aquatic plants. After ingestion, the metacercariae exocyst in the duodenum attaches to the intestinal wall. Option: C. Ascaris lumbricoides - Adult worms reside in the small intestine. Adult worms live in the lumen of the small intestine. A female may produce approximately 200,000 eggs per day, passed with feces. Unfertilized eggs may be ingested but are not infective. Larvae develop infectivity within fertile eggs after 18 days to several weeks, depending on the environmental conditions (optimum: moist, warm, shaded soil). After infective eggs are swallowed, the larvae hatch, invade the intestinal mucosa, and are carried via the portal, then systemic circulation to the lungs. The larvae mature further in the lungs (10 to 14 days), penetrate the alveolar walls, ascend the bronchial tree to the throat, and are swallowed. Upon reaching the small intestine, they develop into adult worms. Between 2 and 3 months are required from ingesting the infective eggs to oviposition by the adult female. Adult worms can live 1 to 2 years. Option: D. Schistosoma mansoni - Adult worms reside in the inferior mesenteric plexus. S. mansoni occurs more often in the inferior mesenteric veins draining the large intestine.</p>\n<p><strong>Extraedge:</strong></p><p>Clonorchis sinensis, the Chinese liver fluke, is a liver fluke belonging to the class Trematoda, phylum Platyhelminthes. It infects fish-eating mammals, including humans. In humans, it infects the common bile duct and gall bladder, feeding on bile</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Operculated eggs are seen on microscopy of a fresh stool sample. Which of the following can be ruled out?", "options": [{"label": "A", "text": "Schistosoma mansoni", "correct": true}, {"label": "B", "text": "Clonorchis sinensis", "correct": false}, {"label": "C", "text": "Heterophyes", "correct": false}, {"label": "D", "text": "Fasciolopsis buski", "correct": false}], "correct_answer": "A. Schistosoma mansoni", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Schistosoma mansoni Lays non-operculated eggs with the lateral spine. Schistosoma mansoni is a water-borne parasite of humans, and belongs to the group of blood flukes. The adult lives in the blood vessels near the human intestine. It causes intestinal schistosomiasis. Clinical symptoms are caused by the eggs.</p>\n<p><strong>Highyeild:</strong></p><p>Schistosomiasis, or bilharzia, is a disease caused by parasitic worms. Infection with Schistosoma mansoni, S. crematorium, and S. japonicum causes illness in humans. Eggs are round to oval in shape, operculate (hinged at one end) and contain to distinguish between Schistosoma species: S. mansoni producing oval eggs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Clonorchis sinensis eggs. Clonorchis sinensis eggs are small. The eggs are oval-shaped with a convex operculum that rests on visible “shoulders” at the smaller end of the egg. At the opposite (opercular) lot, a small knob or hook-like protrusion is often visible. The eggs of a C. sinensis are released through the biliary tract and excreted out along with the feces. The eggs are embryonated and contain the larvae called miracidia. Unlike most other flukes in which the miracidia undergo development and swim in the water to infect a suitable host, the eggs of C. Sinensis. Option C. Eggs are hard to distinguish from C. Sinensis Option D. The mammalian hosts become infected by ingesting metacercariae on the aquatic plants. After ingestion, the metacercariae exocyst in the duodenum attaches to the intestinal wall.</p>\n<p><strong>Extraedge:</strong></p><p>Schistosoma mansoni eggs are large (114 to 180 µm long by 45-70 µm wide) and have a characteristic shape, with a prominent lateral spine near the posterior end. The anterior end is tapered and slightly curved. When the eggs are excreted in stool, they contain a mature miracidium</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Stool examination shows the eggs (140 X 80 microns) shown in the Image. Diagnosis is?", "options": [{"label": "A", "text": "Schistosomiasis", "correct": false}, {"label": "B", "text": "Ascariasis", "correct": false}, {"label": "C", "text": "Fascioliasis", "correct": true}, {"label": "D", "text": "Giardiasis", "correct": false}], "correct_answer": "C. Fascioliasis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689241071984-QTDV037006IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Fascioliasis The given image shows an operculated egg characteristic of Fasciola (trematode).</p>\n<p><strong>Highyeild:</strong></p><p>Fascioliasis (Fasciola Infection): The young worms move through the intestinal wall, the abdominal cavity, and the liver tissue into the bile ducts, where they develop into mature adult flukes that produce eggs. The pathology typically is most pronounced in the bile ducts and liver. Fasciolosis is a parasitic worm infection caused by the common liver fluke Fasciola hepatica. Fascioliasis belongs to the group of foodborne trematode infections. Fascioliasis is a waterborne and foodborne zoonotic disease caused by Fasciola hepatica. Immature Fasciola eggs are discharged in the biliary ducts.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Size of the egg in schistosomiasis is 40-70 microns only Option B. Size of the egg in ascariasis is 45-75 microns only Option D. size of the egg in giardiasis is 10-14 microns only</p>\n<p><strong>Extraedge:</strong></p><p>Fasciola hepatica eggs. are broadly ellipsoidal, are operculated, measure 130–150 µm long by 60–90 µm wide, and are passed unembryonated in feces. Fasciola spp. eggs can be difficult to distinguish from Fasciolopsis buski eggs, although the abopercular end of Fasciola spp</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A man in his twenties presents in the emergency room with shortness of breath and fatigue. He is also very pale. Two days earlier, he was given penicillin for an infection. He had penicillin previously without problems and stated that he had “no allergy” to penicillin. Laboratory testing shows that antibodies to penicillin are present in the patient’s serum and that he is breaking down his red blood cells. He is diagnosed with immune hemolytic anemia. The patient has which type of hypersensitivity reaction?", "options": [{"label": "A", "text": "Type I", "correct": false}, {"label": "B", "text": "Type II", "correct": true}, {"label": "C", "text": "Type III", "correct": false}, {"label": "D", "text": "Type IV", "correct": false}], "correct_answer": "B. Type II", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Type II In the Gell and Coombs classification of allergic reactions, Type II hypersensitivity is an antibody-mediated process in which IgG and IgM antibodies are directed against antigens on cells (such as circulating red blood cells) or extracellular material (such as basement membrane).</p>\n<p><strong>Highyeild:</strong></p><p>Type II hypersensitivity is an antibody-dependent process in which specific antibodies bind to antigens, resulting in tissue damage or destruction. Autoimmune hemolytic anemia is a rare red blood cell disorder and an immune disorder. It happens when the body produces antibodies that destroy the red blood cells. Hemolytic anaemia develops when there are not enough red blood cells because the body destroys them sooner.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C and D : Type I: reaction med Iated by IgE antibodies. Type II: cytotoxic reaction mediated by IgG or IgM antibodies. Type III: reaction mediated by immune complexes. Type IV: delayed reaction mediated by the cellular response.</p>\n<p><strong>Extraedge:</strong></p><p>Type II hypersensitivity reaction refers to an antibody-mediated immune reaction in which antibodies (IgG or IgM) are directed against cellular or extracellular matrix antigens, resulting in cellular destruction, functional loss, or damage to tissues. Damage can occur through multiple mechanisms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 65-year-old male patient was given allogenic bone marrow transplantation four weeks back for his leukaemia diagnosis. Bone marrow was taken from a 25-year-old healthy male donor having no other illness. He now presents to emergency with complaints of generalised maculopapular skin rash, yellowish discolouration of sclera and skin, and passage of watery stools 6 to 8 times a day for two days. On abdomen examination, the liver and spleen were palpable below the costal margin. Blood tests were sent, and results showed raised lymphocytes on CBC and, raised Bilirubin level ( 7 mg/dl), raised ALP level. Which type of Hypersensitivity is this?", "options": [{"label": "A", "text": "Type 1 HS", "correct": false}, {"label": "B", "text": "Type 2 HS", "correct": false}, {"label": "C", "text": "Type 3 HS", "correct": false}, {"label": "D", "text": "Type 4 HS", "correct": true}], "correct_answer": "D. Type 4 HS", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Type 4 HS The diagnosis is acute GVHD. Acute GVHD usually occurs within the first three months after an allogeneic transplant with a peak onset of around four weeks and is characterised by an erythematous maculopapular rash, persistent anorexia or diarrhoea, or both; and by liver disease with increased serum levels of bilirubin, alanine and aspartate aminotransferase, and alkaline phosphatase. In all these organs, endothelial damage and lymphocytic infiltrates are seen. Factors associated with a greater risk of acute GVHD include HLA-mismatching between recipient and donor, patient and donor age, more intense preparative regimens and use of multiparous women as donors.</p>\n<p><strong>Highyeild:</strong></p><p>Type IV- This reaction is mediated by T cells, not antibodies, leading to an inflammatory response against the allergen. Examples of type IV hypersensitivity reactions include the tuberculosis skin test and contact dermatitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- A, B & C. As it is Type 4 HS, Options A, B and C are incorrect. Type I: reaction mediated by IgE antibodies. Type II: cytotoxic reaction mediated by IgG or IgM antibodies. Type III: reaction mediated by immune complexes. Type IV: delayed reaction mediated by the cellular response.</p>\n<p><strong>Extraedge:</strong></p><p>IgE-Mediated Hypersensitivity IgG-Mediated Cytotoxic Hypersensitivity Immune Complex-Mediated Hypersensitivity Cell-Mediated Hypersensitivity IgE is bound to mast cells via its Fc portion. When an allergen binds to these antibodies, crosslinking of IgE induces degranulation. Cells are destroyed by bound antibody, either by activation of complement or by a cytotoxic T cell with an Fc receptor for the antibody (ADCC) Antigen-antibody complexes are deposited in tissues, causing activation of complement, which attracts neutrophils to the site Th1 cells secrete cytokines, which activate macrophages and cytotoxic T cells and can cause macrophage accumulation at the site Causes localized and systemic anaphylaxis, seasonal allergies including hay fever, food allergies such as those to shellfish and peanuts, hives, and eczema Red blood cells destroyed by complement and antibody during a transfusion of mismatched blood type or during erythroblastosis fetalis Most common forms of immune complex disease are seen in glomerulonephritis, rheumatoid arthritis, and systemic lupus erythematosus Most common forms are contact dermatitis, tuberculin reaction, autoimmune diseases such as diabetes mellitus type I, multiple sclerosis, and rheumatoid arthritis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient in your OPD has allergic rhinitis. The pharmacological mediators of Type I Hypersensitivity reaction are all of the following except:", "options": [{"label": "A", "text": "TNF-alpha", "correct": false}, {"label": "B", "text": "IL-2", "correct": true}, {"label": "C", "text": "Leukotriene C4", "correct": false}, {"label": "D", "text": "Histamine", "correct": false}], "correct_answer": "B. IL-2", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IL-2 Is incorrect. Its IL-4, not IL-2. IL-2 is seen in Type IV HSR. All options are explained below.</p>\n<p><strong>Highyeild:</strong></p><p>Type I hypersensitivity is also known as an immediate reaction and involves immunoglobulin E (IgE) mediated release of antibodies against the soluble antigen. This results in mast cell degranulation and the release of histamine and other inflammatory mediators.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Pharmacologic mediators of type I hypersensitivity are listed as follows: Histamine— (OPTION D) Histamine exists in a preformed state in platelets and granules of mast cells, basophils, and eosinophils. The histamine release causes vasodilation, increased capillary permeability, and smooth muscle contraction (g., bronchospasm). Antihistamine drugs can block histamine receptor sites and are relatively effective in allergic rhinitis. Histamine is one of the primary mediators of a type I reaction. Prostaglandins and leukotrienes—Prostaglandins and leukotrienes are newly formed mediators derived from arachidonic acid via the cyclooxygenase pathway. Prostaglandins induce oedema and bronchoconstriction. Leukotriene B4 is a chemoattractant that activates and recruits’ leukocytes to the injury site. Leukotrienes C4 (OPTION C) and D4 cause vasodilation and vascular permeability. These mediators, along with TNF-α (OPTION A) and IL-4 (OPTION B alternate), are referred to as secondary mediators of a type I reaction.</p>\n<p><strong>Extraedge:</strong></p><p>IL-2 is critical for the development of Tregs in the thymus and the regulation, proliferation, and maintenance of Tregs in peripheral tissues, and is essential for maintaining the transcriptional program required for Treg function.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient comes to your clinic complaining of excessive itching over hands and legs, sneezing and watering of eyes. She says her father has the same complaints on and off. You suspect Atopic hypersensitivity. All of the following statements are true with respect to your diagnosis, except:", "options": [{"label": "A", "text": "It exhibits genetic/familial predisposition", "correct": false}, {"label": "B", "text": "Associated with elevated levels of IgM", "correct": true}, {"label": "C", "text": "Common clinical manifestations include hay fever, asthma, eczema, and urticaria", "correct": false}, {"label": "D", "text": "Patients experience immediate-type reactions to skin tests involving the offending antigen.", "correct": false}], "correct_answer": "B. Associated with elevated levels of IgM", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Associated with elevated levels of IgM Is incorrect. It's elevated levels of IgE, not IgM.</p>\n<p><strong>Highyeild:</strong></p><p>Type I hypersensitivities include atopic diseases, which are exaggerated IgE-mediated immune responses (i.e., allergic: asthma, rhinitis, conjunctivitis, and dermatitis), and allergic diseases, which are immune responses to foreign allergens (i.e., anaphylaxis, urticaria, angioedema, food, and drug allergies).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Atopic hypersensitivity disorders exhibit a strong familial predisposition (OPTION A) and are associated with elevated IgE levels (OPTION B). Predisposition to atopy is genetic, but the symptoms are induced by exposure to specific allergens. These antigens are typically environmental (g., respiratory allergy to pollens, ragweed, or house dust) or foods (e.g., intestinal allergy to shellfish). Common clinical manifestations include hay fever, asthma, eczema, and urticaria (OPTION C). Many patients experience immediate-type reactions to skin tests (injection, patch, scratch) involving the offending antigen. (OPTION D)</p>\n<p><strong>Extraedge:</strong></p><p>Type I hypersensitivity is also known as an immediate reaction and involves immunoglobulin E (IgE) mediated release of antibodies against the soluble antigen. This results in mast cell degranulation and release of histamine and other inflammatory mediators.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "During 2nd-year microbiology lectures, you’re asked to enumerate an example of a Type III hypersensitivity reaction. The correct option from amongst the following is:", "options": [{"label": "A", "text": "Rh haemolytic disease", "correct": false}, {"label": "B", "text": "Acute post-streptococcal glomerulonephritis", "correct": true}, {"label": "C", "text": "Hay fever", "correct": false}, {"label": "D", "text": "ABO transfusion reaction", "correct": false}], "correct_answer": "B. Acute post-streptococcal glomerulonephritis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acute post-streptococcal glomerulonephritis Type III HSR. Acute poststreptococcal glomerulonephritis is a well known immune complex disease. Its onset takes place several weeks after a group A ẞ-hemolytic streptococcal infection, particularly of the skin, and often occurs with infection due to nephritogenic types of streptococci. The complement level is typically low, suggesting an antigen-antibody reaction with consumption of complement. Lumpy deposits of immunoglobulin and complement component, C3, are observed along the glomerular basement membrane. These membranes can be stained by immunofluorescence and visualized under UV microscopy. This type of pattern reveals antigen-antibody complexes. It is likely that streptococcal antigen-antibody complexes are filtered out by glomeruli, fix complement, and attract neutrophils. This series of events results in an inflammatory process that damages the kidney.</p>\n<p><strong>Highyeild:</strong></p><p>In type III hypersensitivity reactions, an abnormal immune response is mediated by forming antigen-antibody aggregates called \"immune complexes. They can precipitate in tissues such as skin, joints, vessels, or glomeruli and trigger the classical complement pathway. Complement activation leads to the recruitment of inflammatory cells (monocytes and neutrophils) that release lysosomal enzymes and free radicals at the site of immune complexes, causing tissue damage. The most common diseases involving a type III hypersensitivity reaction are serum sickness, post-streptococcal glomerulonephritis, systemic lupus erythematosus, farmers' lung (hypersensitivity pneumonitis), and rheumatoid arthritis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A and D. Type II HSR. Type II hypersensitivity involves binding IgG antibodies to cell surface antigens or extracellular matrix molecules. Antibodies directed at cell surface antigens can activate complement to damage the cells. The result may be complement-mediated lysis, which occurs in haemolytic anaemia, ABO transfusion reactions, and Rh haemolytic disease. (OPTION B): Type III HSR. Acute poststreptococcal glomerulonephritis is a well known immune complex disease. Its onset takes place several weeks after a group A ẞ-haemolytic streptococcal infection, particularly of the skin, and often occurs with infection due to nephritogenic types of streptococci. The complement level is typically low, suggesting an antigen-antibody reaction with consumption of complement. Lumpy deposits of immunoglobulin and complement component, C3, are observed along the glomerular basement membrane. These membranes can be stained by immunofluorescence and visualized under UV microscopy. This type of pattern reveals antigen-antibody complexes. It is likely that streptococcal antigen-antibody complexes are filtered out by glomeruli, fix complement, and attract neutrophils. This series of events results in an inflammatory process that damages the kidney. (OPTION C): Type I HSR. Type I hypersensitivity manifests itself in tissue reactions occurring within seconds after the antigen combines with specific IgE antibody. Its symptoms may manifest as a systemic anaphylaxis (eg, after intravenous administration of heterologous proteins) or as a local reaction (eg, an atopic allergy involving rhinitis such as occurs with hay fever).</p>\n<p><strong>Extraedge:</strong></p><p>According to this system, known as the Gell and Coombs classification or Gell-Coombs's classification, there are four types of hypersensitivity, namely, type I, which as an IgE mediated immediate reaction; type II, an antibody-mediated reaction mainly involving IgG or IgM; type III, an immune complex-mediated reaction.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 15 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 13-year-old female patient visited OPD complaining of runny nose, backache, cough, fever and chills from the past 5 days. Many immunological mechanisms and mediators are involved in dealing with infections. Which of the following infections will be responsible for stimulating interferon alpha(α)?", "options": [{"label": "A", "text": "Bacterial infections", "correct": false}, {"label": "B", "text": "Parasitic infections", "correct": false}, {"label": "C", "text": "Viral infection", "correct": true}, {"label": "D", "text": "Tuberculosis", "correct": false}], "correct_answer": "C. Viral infection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Viral infection Interferon alpha and interferon beta for antiviral substances produced against viral infection.</p>\n<p><strong>Highyeild:</strong></p><p>Interferon alpha binds to type I interferon receptors (IFNAR1 and IFNAR2c) which, upon dimerisation, activate two Jak (Janus kinase) tyrosine kinases (Jak1 and Tyk2). These transphosphorylate themselves and phosphorylate the receptors. Interferon Alfa: Endogenous glycoprotein or cytokine that produced by human leukocytes and exert anitviral, immunomodulatory (immunostimulants) and antiproliferative activities. Commercially available as: Interferon alfa-2b: Licensed for Rx of HBV and acute hepatitis C. Interferon alfa-2a: can be used for HCV (Either alone or better with oral Ribaverin Note: Both types can be used for HCV MOA: Unclear but may be via the induction of host cell enzymes that inhibit viral penetration, translation, transcription, maturation, release. Thus degrading viral mRNA and tRNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: A) Bacterial infections usually trigger humoral immune response and antibody production. Option: B) parasitic infections are characterized by production of IgE immunoglobulin Option: D) Tuberculosis is characterized by granuloma formation under the influence of interferon Gamma secretion.</p>\n<p><strong>Extraedge:</strong></p><p>There are three types of interferons (IFN), alpha, beta and gamma. IFN-alpha is produced in the leukocytes infected with virus, while IFN-beta is from fibroblasts infected with virus. IFN-gamma is induced by the stimulation of sensitized lymphocytes with antigen or non-sensitized lymphocytes with mitogens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "CASE1:- A 10-year-old male patient presented to OPD with a dog bite penetrating into deeper tissues and received anti-rabies immunoglobulin as a post-exposure prophylaxis initially. CASE-2: - A 2 years old male child receiving the oral polio vaccine in the pulse polio program in his primary school Case 1 and case 2, respectively, are examples of?", "options": [{"label": "A", "text": "Active acquired immunity and passive acquired immunity", "correct": false}, {"label": "B", "text": "Passive acquired immunity and active acquired immunity", "correct": true}, {"label": "C", "text": "Primary acquired immunity and secondary acquired immunity", "correct": false}, {"label": "D", "text": "Secondary acquired immunity and primary acquired immunity", "correct": false}], "correct_answer": "B. Passive acquired immunity and active acquired immunity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Passive acquired immunity and active acquired immunity In passive acquired immunity, the antibody is directly received by the host. IgA-rich colostrum from mother to baby and immunoglobulin in post-exposure prophylaxis Antigens enter the host cell in active acquired immunity, and antibodies are formed, as in the case of infection and vaccination.</p>\n<p><strong>Highyeild:</strong></p><p>Two types of immunity exist — active and passive: Active immunity occurs when our immune system protects us from a pathogen. Passive immunity occurs when we are protected from a pathogen by immunity gained from someone else.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The immune response when the antigen enters the first time is primary active immunity. Options C and D. The immune response when the same antigen enters subsequently is known as secondary immunity. So, Options A, C and D. Are incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>A type of immunity that occurs when a person is given antibodies rather than making them through his or her own immune system. For example, passive immunity occurs when a baby receives a mother's antibodies through the placenta or breast milk.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Innate immunity or inborn immunity is a first line of defence mechanism which is nonspecific and not associated with any memory. The innate immunity mechanism involves a variety number of cells and mediators. Which of the following is the mechanism of innate immunity except?", "options": [{"label": "A", "text": "Antigen-presenting cells", "correct": true}, {"label": "B", "text": "Pathogen-associated molecular patterns", "correct": false}, {"label": "C", "text": "Toll-like receptors", "correct": false}, {"label": "D", "text": "Natural killer cells", "correct": false}], "correct_answer": "A. Antigen-presenting cells", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigen-presenting cells</p>\n<p><strong>Highyeild:</strong></p><p>Antigen-presenting cells (APCs) are a heterogeneous group of immune cells that mediate the cellular immune response by processing and presenting antigens for recognition by specific lymphocytes such as T cells. Classical APCs include dendritic cells, macrophages, Langerhans cells and B cells. Antigen-presenting cells like dendritic cells, macrophages and B cells play an essential role in the acquired immunity mechanism by presenting the antigen to T cells and immune activation</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C and D. Innate immunity mechanism involved pathogen-associated molecular patterns, natural killer cells, toll-like receptors, macrophages, cytokines like interleukin 1, 6 and TNF-alpha acute phase reactants and the complement system. Options B, C and D. Are a part of innate immunity.</p>\n<p><strong>Extraedge:</strong></p><p>Antigen-presenting cells (APCs) are a heterogeneous group of immune cells that mediate the cellular immune response by processing and presenting antigens for recognition by certain lymphocytes such as T cells. Classical APCs include dendritic cells, macrophages, Langerhans cells and B cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements is false regarding HLA complex genes?", "options": [{"label": "A", "text": "HLA complex genes are located at the short arm of chromosome 6", "correct": false}, {"label": "B", "text": "MHC-1 is present in all nucleated cells and platelets & presents antigen to cytotoxic T cells in cell-mediated immunity", "correct": false}, {"label": "C", "text": "MHC-2 is present only in antigen-presenting cells, and they present antigen to CD4 T cells", "correct": false}, {"label": "D", "text": "All the above statements are true", "correct": true}], "correct_answer": "D. All the above statements are true", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All the above statements are true</p>\n<p><strong>Highyeild:</strong></p><p>The human leukocyte antigen ( HLA ) system or complex is a complex of genes on chromosome 6 in humans that encode cell-surface proteins responsible for regulating the immune system. [1] The HLA system is also the human version of the major histocompatibility complex (MHC) found in many animals. [2] Mutations in HLA genes may be linked to autoimmune diseases such as type I diabetes and celiac disease. The HLA gene complex resides on a 3 Mbp stretch within chromosome 6, p-arm at 21.3 HLA complex genes are located at the short arm of chromosome 6 MHC-1 is present in all nucleated cells and platelets & presents antigen to cytotoxic T cells in cell-mediated immunity MHC-2 is present only in antigen-presenting cells, and they present antigen to cd4 T cells & and have an essential role in both humoral immunity and cell-mediated immunity</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- All the above statements are true regarding the HLA complex.</p>\n<p><strong>Extraedge:</strong></p><p>major histocompatibility complex (MHC) of genes consists of a linked set of genetic loci encoding many of the proteins involved in antigen presentation to T cells, most notably the MHC class I and class II glycoproteins (the MHC molecules) that present peptides to the T-cell receptor.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 50 years old female presented to OPD with complaints of recurrent URTI upper respiratory tract infection. various immunological mechanisms play an essential role in defence towards a pathogenic condition. complement proteins are plasma mediators synthesised from the liver, which plays an important role in various immunological mechanisms. The complement system's ultimate role is forming a membrane attack complex. Complements forming membrane attack complexes are?", "options": [{"label": "A", "text": "C6,7,8,9", "correct": false}, {"label": "B", "text": "C5", "correct": false}, {"label": "C", "text": "C1,2,3", "correct": false}, {"label": "D", "text": "C5,6,7,8,9", "correct": true}], "correct_answer": "D. C5,6,7,8,9", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C5,6,7,8,9 Complement proteins form membrane attack complex c 5 6 7 8 and 9, which results in cytolysis by humoral immunity mechanisms.</p>\n<p><strong>Highyeild:</strong></p><p>Assembly of C5b-9 on cell membranes results in transmembrane channels and causes cell death. When the number of C5b-9 molecules is limited, nucleated cells can escape cell death by endocytosis and by shedding membranes bearing C5b-9.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The membrane attack complex is formed by complement system activation after a cascade of reactions through the classical complement pathway / alternative complement pathway /lectin pathway. Options A, B and C. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>The protein products of the MHC have been classified into three classes: class I and II (both of which are involved in antigen presentation) and III molecules. Class I and II proteins are integral components of the immune system whose primary role is the presentation of peptide antigen to T-cell receptor.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the wrong pair regarding various cells in immunological mechanisms?", "options": [{"label": "A", "text": "Natural killer cells- acquired immunity", "correct": true}, {"label": "B", "text": "T cytotoxic cells - perforins & granzymes", "correct": false}, {"label": "C", "text": "B cells- plasma cells and antibodies", "correct": false}, {"label": "D", "text": "Antigen-presenting cells -dendritic cells", "correct": false}], "correct_answer": "A. Natural killer cells- acquired immunity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Natural killer cells- acquired immunity Natural killer cells are large granular lymphocytes that play an important role in the mechanism of innate immunity.</p>\n<p><strong>Highyeild:</strong></p><p>Natural killer (NK) cells are effector lymphocytes of the innate immune system that control several types of tumours and microbial infections by limiting their spread and subsequent tissue damage.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. T cytotoxic cells secrete perforins and granzymes and are responsible for cell-mediated immunity. Option C. B cells differentiate into plasma cells which secrete antibodies and are responsible for humoral immunity. Option D. Antigen-presenting cells present antigens to T cells after processing. Dendritic cells are the most common and most potent antigen-presenting cells. Option B, C and D. Are correct matches.</p>\n<p><strong>Extraedge:</strong></p><p>A type of immune cell that has granules (small particles) with enzymes that can kill tumor cells or cells infected with a virus. A natural killer cell is a type of white blood cell. Also called NK cell and NK-LGL.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Mononuclear macrophages serve different functions in different tissues. All the following are correct regarding mononuclear macrophages except:", "options": [{"label": "A", "text": "B-cells-lymph node", "correct": true}, {"label": "B", "text": "Kupffer cells-Liver", "correct": false}, {"label": "C", "text": "Microglial cells-CNS", "correct": false}, {"label": "D", "text": "Histiocytes-connective tissue", "correct": false}], "correct_answer": "A. B-cells-lymph node", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>B-cells-lymph node B-cells are Lymphocytes, not macrophages.</p>\n<p><strong>Highyeild:</strong></p><p>B lymphocytes originate in the bone marrow; their goal is to recognise an antigen. Each of them responds to the antigen in a specific way, as it expresses specific antibodies on the membrane (IgM, CD79a, and CD79b).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Macrophages are derived from monocytes & serve different functions in different tissues they are named according to their tissue location. Option B. Kupffer cells-Liver Option C. Microglial cells-CNS Option D. Histiocytes-connective tissue</p>\n<p><strong>Extraedge:</strong></p><p>Kupffer cells are resident liver macrophages and play a critical role in maintaining liver functions. Under physiological conditions, they are the first innate immune cells and protect the liver from bacterial infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which statement is true of the adaptive, but not the innate immune response?", "options": [{"label": "A", "text": "Receptors are highly specific", "correct": true}, {"label": "B", "text": "It fights both viruses and bacteria.", "correct": false}, {"label": "C", "text": "Many cells coordinate together to mount it.", "correct": false}, {"label": "D", "text": "Pathogens have evolved to fight it.", "correct": false}], "correct_answer": "A. Receptors are highly specific", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Receptors are highly specific The adaptive immune system, also referred to as the acquired immune system, is a subsystem of the immune system that is composed of specialised, systemic cells and processes that eliminates pathogens by preventing their growth.</p>\n<p><strong>Highyeild:</strong></p><p>The acquired immune system is one of vertebrates' two main immunity strategies. Adaptive immunity is also called acquired immunity or specific immunity and is only found in vertebrates. The adaptive immune response is specific to the pathogen The adaptive immune response is meant to attack non-self pathogens but can sometimes make errors and attack itself.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. It fights both viruses and bacteria. - true for both Option C. Many cells coordinate together to mount it. - both have multiple cells in them. Option D. This is true for both types. Options B, C and D. Are true about innate immunity.</p>\n<p><strong>Extraedge:</strong></p><p>The Kupffer cell is located to the hepatic sinusoid and is therefore in close proximity to other cells in the sinusoid, including natural killer (NK) and natural killer T cells (NKT), as well as the liver sinusoidal endothelial cells (LSEC).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pattern Recognition Receptors (PRRs) are proteins capable of recognizing molecules frequently found in pathogens . Pattern recognition receptors (PRR) include:", "options": [{"label": "A", "text": "PAMP’S Pathogen‐associated molecular pattern molecules", "correct": false}, {"label": "B", "text": "LPS Lipopolysacharides", "correct": false}, {"label": "C", "text": "CRP C-reactive protein AND MBL metallo beta-lactamase", "correct": true}, {"label": "D", "text": "Flagellin", "correct": false}], "correct_answer": "C. CRP C-reactive protein AND MBL metallo beta-lactamase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>CRP C-reactive protein AND MBL metallo beta-lactamase Cells that typically have pattern recognition receptors include macrophages, dendritic cells, endothelial cells, mucosal epithelial cells, and lymphocytes.</p>\n<p><strong>Highyeild:</strong></p><p>Many pattern-recognition receptors are located on the surface of these cells, where they can interact with PAMPs on the surface of microbes. MBLmetallo beta-lactamase, mannose-binding lectin; CRP, C- reactive protein; SR, scavenger, often include substances that stimulate pattern recognition receptors (PRRs).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B and D. Are not the PPRs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A vaccine is a biological preparation that provides active acquired immunity to a particular infectious disease. A vaccine typically contains an agent that resembles a disease-causing microorganism and is often made from weakened or killed forms of the microbe, its toxins, or one of its surface proteins. Which vaccine is contraindicated in pregnancy?", "options": [{"label": "A", "text": "Hep A", "correct": false}, {"label": "B", "text": "Hep B", "correct": false}, {"label": "C", "text": "Rabies", "correct": false}, {"label": "D", "text": "Chickenpox", "correct": true}], "correct_answer": "D. Chickenpox", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chickenpox Live vaccines administered to a pregnant woman pose a theoretical risk to the fetus; therefore, live, attenuated virus and live bacterial vaccines generally are contraindicated during pregnancy.</p>\n<p><strong>Highyeild:</strong></p><p>Examples of vaccines to avoid during pregnancy include Chickenpox (varicella) vaccine. The varicella vaccine contains live attenuated varicella-zoster virus. Immunization during pregnancy is contraindicated. Routine Inactivated influenza vaccine (IIV) Tdap (TT/Td) Contraindicated MMR Varicella Live attenuated influenza vaccine (LAIV) Pregnancy not a contraindication Pneumococcal PS/C Hepatitis B Hepatitis A Meningococcal PS/C Inactivated poliovirus Yellow fever</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Hep A - not C/I Option B. Hep B - not C/I Option C. Rabies - not C/I Option A, B and C. They are not live vaccines - so they can be given in pregnancy.</p>\n<p><strong>Extraedge:</strong></p><p>Chickenpox is a highly contagious disease caused by the varicella-zoster virus (VZV). It can cause an itchy, blister-like rash among other symptoms. The rash first appears on the chest, back, and face, and then spreads over the entire body.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male patient from India was diagnosed with Uncomplicated malaria. On thin smear examination, the species found was Plasmodium falciparum. Providing the same condition except the location being Africa another individual didn’t contract falciparum infection. Choose the correct response for the above racial immunity?", "options": [{"label": "A", "text": "Acquired abnormality of red cells (sickling) prevalent in that area", "correct": false}, {"label": "B", "text": "Hereditary abnormality of red cells (sickling)in that area", "correct": true}, {"label": "C", "text": "Duffy negative RBCs are resistant to falciparum species", "correct": false}, {"label": "D", "text": "Duffy positive RBCs are resistant to falciparum species", "correct": false}], "correct_answer": "B. Hereditary abnormality of red cells (sickling)in that area", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hereditary abnormality of red cells (sickling)in that area Hereditary abnormality of red cells i.e., sickling is responsible for resistance to falciparum species in some parts of Africa and the Mediterranean coast. This is an example of racial innate immunity.</p>\n<p><strong>Highyeild:</strong></p><p>' Sickle cell trait (AS) confers partial protection against lethal Plasmodium falciparum malaria. Multiple mechanisms for this have been proposed, with a recent focus on aberrant cytoadherence of parasite-infected red blood cells (RBCs)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. There is no such terminology acquired sickling. Option C & D. Duffy antigen present on RBCs is responsible for infection with vivax species, not falciparum. Duffy-negative RBCs are responsible for resistance to vivax species. Duffy Blood Group Predominant genes (codominant alleles): Fy i and Fy code for antigens that are well developed at birth Antigens are destroyed by enzymes Show dosage Phenotypes Blacks Whites Fy(a+b-) 9 17 Fy(a+b+) 1 49 Fy(a-b+) 22 34 Fy(a-b-) 68 RARE</p>\n<p><strong>Extraedge:</strong></p><p>Plasmodium falciparum is a unicellular protozoan parasite of humans, and the deadliest species of Plasmodium that causes malaria in humans. The parasite is transmitted through the bite of a female Anopheles mosquito and causes the disease's most dangerous form, falciparum malaria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old woman primigravida woman at 26 weeks gestation comes for her first antenatal visit and as a protocol tetanus immunisation is suggested. Select the correct statement regarding immunisation?", "options": [{"label": "A", "text": "Active immunisation of mothers during pregnancy improve the quality of passive immunity in infants", "correct": true}, {"label": "B", "text": "Active immunization of mothers during pregnancy improves the quality of active immunization in infants", "correct": false}, {"label": "C", "text": "Passive immunization of mothers during pregnancy improves the quality of active immunity in infants", "correct": false}, {"label": "D", "text": "Passive immunization of mothers during pregnancy improves the quality of passive immunization in infants", "correct": false}], "correct_answer": "A. Active immunisation of mothers during pregnancy improve the quality of passive immunity in infants", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Active immunisation of mothers during pregnancy improve the quality of passive immunity in infants Immunization of pregnant women with TT is recommended for this purpose.</p>\n<p><strong>Highyeild:</strong></p><p>The tetanus toxoid, reduced diphtheria toxoid, and acellular pertussis (Tdap) vaccines are safe for both mother and baby, to administer any time during pregnancy Vaccination Schedule TT-1 During the first pregnancy TT-2 1 month after the first dose TT-3 6 months after the second dose TT-4 1 year after the third dose TT-5 1 year after the fourth dose</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B, C & D. Vaccination of the mother is active immunisation, and the baby will get formed antibodies from mother called passive immunization (Not active).</p>\n<p><strong>Extraedge:</strong></p><p>Tetanus is an infection caused by bacteria called Clostridium tetani. When these bacteria enter the body, they produce a toxin that causes painful muscle contractions. Another name for tetanus is “lockjaw”. It often causes a person's neck and jaw muscles to lock, making it hard to open the mouth or swallow.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 40-year male resident of Bihar come with complaint of skin lesion mostly nodules, without loss of sensation, thickening of peripheral nerves with diminished sensation and burning or tingling sensation since many months. As an experiment, he was given some transfer factors in an attempt to treat the underlying condition. What kind of immunity this transfer factor represents?", "options": [{"label": "A", "text": "Innate immunity", "correct": false}, {"label": "B", "text": "Adoptive immunity", "correct": true}, {"label": "C", "text": "Acquired immunity", "correct": false}, {"label": "D", "text": "Adaptive immunity", "correct": false}], "correct_answer": "B. Adoptive immunity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Adoptive immunity</p>\n<p><strong>Highyeild:</strong></p><p>A special type of immunization is the injection of immunologically competent lymphocytes, known as adoptive immunity. Here, instead of whole lymphocytes, an extract of immunologically competent lymphocytes known as transfer factor is used.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Innate immunity is the first line of defence against infections. It is resistance to infection that an individual possesses by his or her genetic and constitutional makeup. Option C & D. The resistance that an individual acquires during life by recognising and selectively eliminating specific foreign molecules is known as acquired or adaptive immunity. They possess antigenic specificity, diversity and immunological memory.</p>\n<p><strong>Extraedge:</strong></p><p>Tetanus is an infection caused by bacteria called Clostridium tetani. When these bacteria enter the body, they produce a toxin that causes painful muscle contractions. Another name for tetanus is “lockjaw”. It often causes a person's neck and jaw muscles to lock, making it hard to open the mouth or swallow.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which statement is incorrect regarding phenomena shown in image?", "options": [{"label": "A", "text": "This is a crucial method of protection in immunosuppressive and immunodeficient individuals in whom vaccines are contraindicated", "correct": false}, {"label": "B", "text": "Once the herd immunity threshold has been reached, the disease gradually disappears from population", "correct": false}, {"label": "C", "text": "Herd immunity concept can apply to Tetanus", "correct": true}, {"label": "D", "text": "Herd immunity can be achieved by both vaccination and previous infection", "correct": false}], "correct_answer": "C. Herd immunity concept can apply to Tetanus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245607700-QTDV046016IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Herd immunity concept can apply to Tetanus Herd immunity concept does not apply to Tetanus. As the infection is acquired from the environment, rather than being passed from person to person, no Herd immunity is observed for tetanus. Therefore, every person needs to be individually protected.</p>\n<p><strong>Highyeild:</strong></p><p>'Herd immunity', also known as 'population immunity', is the indirect protection from an infectious disease that happens when a population is immune either through vaccination or immunity developed through previous infection</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B & D. The image correctly represent how herd immunity can be achieved and beneficial to those group of community in which vaccination is not possible (immunodeficient and immunosuppressive). Once the threshold of herd immunity is reached, the disease gradually disappears from the population, e.g. measles has a very high threshold and requires at least 95% immunization. So, all these statements are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A vaccine is a biological preparation that provides active acquired immunity to a particular infectious disease. A vaccine typically contains an agent that resembles a disease-causing microorganism and is often made from weakened or killed forms of the microbe, its toxins, or one of its surface proteins. Conjugate vaccines are:", "options": [{"label": "A", "text": "H. Influenza", "correct": false}, {"label": "B", "text": "Strep pneumonia", "correct": false}, {"label": "C", "text": "N. meningitidis Group C", "correct": false}, {"label": "D", "text": "N. meningitides Group B", "correct": true}], "correct_answer": "D. N. meningitides Group B", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>N. meningitides Group B Vaccines against serotype B meningococcal disease have proved difficult to produce as the capsular polysaccharide on the type B bacterium is too similar to human neural antigens to be a useful target. Also, the capsule of serogroup B (made up of sialic acid) is less immunogenic. It is also encephalitogenic due to the expression of similar cross-reactive antigens on neural cells.</p>\n<p><strong>Highyeild:</strong></p><p>Meningococcal vaccine refers to any vaccine used to prevent infection by Neisseria meningitidis. Different versions are effective against some or all of the following types of meningococcus: A, B, C, W-135, and Y. The vaccines are between 85 and 100% effective for at least two years. To potentiate the immunogenicity of polysaccharide components, carrier proteins are conjugated with polysaccharides.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B & C. Conjugate vaccines are available for pneumococcus, influenza, and N. meningitides groups A, C, Y and W-13(5.) Option C. The first meningococcal conjugate vaccine (MCV-4) was licensed in 2005 by Sanofi Pasteur. Efficacy-95%.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Innate, or nonspecific, immunity is the defence system with which you were born. It protects you against all antigens. Innate immunity involves barriers that keep harmful materials from entering your body. These barriers form the first line of defense in the immune response. All are true about innate immunity except?", "options": [{"label": "A", "text": "Acts as the first line of defence", "correct": false}, {"label": "B", "text": "Complements are examples", "correct": false}, {"label": "C", "text": "Nonspecific", "correct": false}, {"label": "D", "text": "Not affected by genetic influences", "correct": true}], "correct_answer": "D. Not affected by genetic influences", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Not affected by genetic influences Innate immunity depends on the individual's genetic constitution. Homogenous identical twins exhibit similar degrees of innate.</p>\n<p><strong>Highyeild:</strong></p><p>The innate immune system is the body's first line of defence against germs entering the body. It responds similarly to all germs and foreign substances, which is why it is sometimes called the \"nonspecific\" immune system.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Innate immunity acts as the first line of Option B. Complement system is essential for both innate and adaptive Option C. Innate immunity refers to the nonspecific resistance to infection that an individual poses from birth by its genetic or constitutional make</p>\n<p><strong>Extraedge:</strong></p><p>The innate immune responses are the first line of defense against invading pathogens. They are also required to initiate specific adaptive immune responses. Innate immune responses rely on the body's ability to recognize conserved features of pathogens that are not present in the uninfected host.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "When complement is activated on a cell surface, the activation is limited by endogenous complement regulatory proteins, which include CD35, CD46, CD55 and CD59, depending on the cell. Complement which leads to the killing of an organism and protects us?", "options": [{"label": "A", "text": "C2345", "correct": false}, {"label": "B", "text": "C56789", "correct": true}, {"label": "C", "text": "C34567", "correct": false}, {"label": "D", "text": "C3456", "correct": false}], "correct_answer": "B. C56789", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C56789 C56789 is known as a membrane attack complex, which causes microbial lysis.</p>\n<p><strong>Highyeild:</strong></p><p>Membrane attack complex (MAC) is an important immune effector of the complement terminal pathway composed of complement components C5b, C6, C7, C8, and C9. MAC is the collective come-off of three complement pathways (classical, lectin, or alternative pathway) that penetrate the cell membranes of microbes to form cytotoxic pores. These pores disrupt the phospholipid bilayers of target cell membrane or form hydrophilic transmembrane channels, leading to cell lysis and death.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, C & D. Incorrect, as all C56789 are required for MAC formation.</p>\n<p><strong>Extraedge:</strong></p><p>The complement system is part of your body's immune system that cleans up damaged cells, helps your body heal after an injury or an infection and destroys microscopic organisms like bacteria that make you sick. Your complement system is the front line of defense for your immune system.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Active Immunity results when exposure to a disease organism triggers the immune system to produce antibodies to that disease. Active immunity can be acquired through natural immunity or vaccine-induced immunity. True about passive immunity:", "options": [{"label": "A", "text": "Cannot be given with active immunity", "correct": false}, {"label": "B", "text": "Last for 4-5 days only", "correct": false}, {"label": "C", "text": "It can be given before disease occurrence", "correct": true}, {"label": "D", "text": "Takes longer time to develop", "correct": false}], "correct_answer": "C. It can be given before disease occurrence", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It can be given before disease occurrence Immunoglobulins should be given immediately after the exposure but before the disease occurrence. Passive immunity can be transferred between individuals by Serum therapy (antibodies).</p>\n<p><strong>Highyeild:</strong></p><p>Passive immunity is provided when a person is given antibodies to a disease rather than producing them through his or her immune system. A newborn baby acquires passive immunity from its mother through the placenta.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Immunoglobulins can be given along with vaccine in postexposure prophylaxis, e.g. Rabies immunoglobulins:- Option B. Passive immunity last for days to months. Option D. Passive immunity works immediately.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 28 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A group of researchers is investigating the causative agents responsible for infections in immune-compromised individuals. Patients with solid organ malignancy who have received conventional chemotherapy are enrolled in the study. Detailed microbiologic data are obtained on any patient who develops a fever during chemotherapy-induced neutropenia. Which of the following types of pathogens are most likely to be obtained in the majority of these patients?", "options": [{"label": "A", "text": "Environmental, opportunistic pathogens", "correct": false}, {"label": "B", "text": "Hospital-acquired, drug-resistant bacteria", "correct": false}, {"label": "C", "text": "Pathogens spread from infected contacts", "correct": false}, {"label": "D", "text": "Patient's own endogenous bacterial flora", "correct": true}], "correct_answer": "D. Patient's own endogenous bacterial flora", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Patient's own endogenous bacterial flora Systemic chemotherapy targets rapidly dividing cancer cells but often incidentally damage other rapidly dividing cells in the gastrointestinal tract and bone marrow, which dramatically increases the risk of infection due to the following: Mucositis - Damage to rapidly dividing epithelial cells of the digestive tract creates breaches in the mucosal barrier that allow endogenous bacterial flora (commensal organisms) to penetrate and enter the bloodstream. Gram-negative enteric bacilli, such as Pseudomonas aeruginosa , and gram-positive skin organisms, like Staphylococcus epidermidis and aureus, are most likely to invade. Neutropenia - Damage to rapidly dividing granulopoietic cells reduces circulating neutrophil count. Because neutrophils serve as a front-line defence against bacterial and fungal pathogens, commensal pathogens that penetrate the mucosal/cutaneous barrier cannot be contained and spread to the bloodstream and deeper tissues. Neutropenic patients have weak inflammatory responses, and fever is often the only sign of infection (neutropenic fever).</p>\n<p><strong>Highyeild:</strong></p><p>To reduce the risk of serious infection, patients who receive systemic chemotherapy are often empirically treated with prophylactic antibiotics (g., ciprofloxacin) to prevent commensal organisms from invading and with granulocyte-stimulating agents (e.g., filgrastim) to increase neutrophil count.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Environmental pathogens such as Histoplasma (in bird droppings), Mycobacterium avium complex (in water), and Cryptococcus (in soil contaminated by bird droppings) often cause opportunistic infection in those with advanced AIDS due to impaired cell-mediated immunity. Although these pathogens can cause infections in those with neutropenia, most cases of neutropenic fever are due to endogenous commensal organisms. Option B. Hospital-acquired, drug-resistant bacteria, such as methicillin-resistant S aureus, can cause neutropenic fever but do so much less often than endogenous commensal bacteria. Option C. Pathogens spread from infected contacts (g., influenza) are more likely to cause severe infection in those with impaired immunity. However, the greatest cause of neutropenic fever is endogenous bacterial flora.</p>\n<p><strong>Extraedge:</strong></p><p>Infections arising from a person's own flora are considered endogenous. One way an endogenous infection can occur is for a bacterium which normally resides in one part of the body is introduced to another. An example is E. coli and other Enterobacteriaceae</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Immunity to a disease is achieved through the presence of antibodies to that disease in a person's system. Antibodies are proteins the body produces to neutralise or destroy toxins or disease-carrying organisms. Recurrent Giardiasis is associated with:", "options": [{"label": "A", "text": "Cl esterase deficiency", "correct": false}, {"label": "B", "text": "Common variable immunodeficiency", "correct": true}, {"label": "C", "text": "Di George syndrome", "correct": false}, {"label": "D", "text": "C8 deficiency", "correct": false}], "correct_answer": "B. Common variable immunodeficiency", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Common variable immunodeficiency Recurrent giardiasis is not uncommon – one-third of infected patients may develop recurrent or chronic symptoms.</p>\n<p><strong>Highyeild:</strong></p><p>When assessing a patient with ongoing symptoms following confirmed G. lamblia infection, consider whether it could be: a) post-infectious sequelae, b) reinfection, or c) resistance to treatment. Giardia lamblia is one of the most common parasitic infections. Although standard treatments are usually curative, some immunocompromised patients, including patients with acquired immunodeficiency syndrome and healthy patients, have giardiasis that is refractory to recommended regimens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. No association with giardiasis Option C. Option D. Options A, C and D. Are not associated with recurrent giardiasis.</p>\n<p><strong>Extraedge:</strong></p><p>A disorder caused by a defect in chromosome 22. DiGeorge syndrome is a chromosomal disorder that results in poor development of several bodily systems. Its features vary widely, even among members of the same family. The syndrome can cause heart defects, poor immune system function, a cleft palate and low levels of calcium in the blood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A mother takes her 4-year-old child to a daycare centre. She has noticed that the child’s frequent stools are non-bloody, foul-smelling and fatty. The child has no fever. A parasite infection is suspected. What attribute of this parasite imparts its pathogenicity?", "options": [{"label": "A", "text": "Lytic enzymes", "correct": false}, {"label": "B", "text": "Flagella", "correct": false}, {"label": "C", "text": "Ventral sucking disc", "correct": true}, {"label": "D", "text": "Encystment", "correct": false}], "correct_answer": "C. Ventral sucking disc", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ventral sucking disc The ventral disk is a unique and important component of the G. lamblia cytoskeleton. The ventral disk, often called the sucking or adhesive disk, provides the parasite with powerful adhesion, catching, and holding.</p>\n<p><strong>Highyeild:</strong></p><p>G. lamblia It is 10-12µm long and 5-7µm wide, bilaterally symmetrical, and has two nuclei. It is also relatively flattened, with a large sucking disk on the anterior ventral side. A large sucking disk, which allows the parasite to attach to the surface of the intestinal mucosa of the host, takes up most of the ventral surface of the parasite. Behind the sucking disks, two rods known as median bodies are seen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Generally present in insect vectors or disease, which results in hemolysis. Option B. Giardia uses flagellar motility to find suitable sites for attachment to the intestinal villi. Option D. Encystment Options A, B and D. Are not the features of giardia lambia, which is the most appropriate possible suspect in this case.</p>\n<p><strong>Extraedge:</strong></p><p>Giardiasis spreads through contaminated food or water or by person-to-person contact. It's most common in areas with poor sanitation and unsafe water. Symptoms might include watery diarrhoea alternating with greasy stools. Fatigue, cramps and belching wind may also occur. Some people have no symptoms. Most cases clear up on their own within a few weeks. Severe cases are treated with antibiotics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 18-month-old male child was brought to the physician by the parents with complaints of inability to gain weight. On further evaluation, the parents give a history of chronic diarrhoea from the past few months. The child's growth was normal until the age of 6 months. Later, he started to suffer from recurrent episodes of Pneumonia. Their family history is significant, with similar clinical features in his maternal uncle in the past. On examination, he is below the 3rd percentile of the weight. The stool is positive for Giardiasis. Which of the following is false regarding the patient’s condition?", "options": [{"label": "A", "text": "The condition is associated with BTK (Bruton’s Tyrosine Kinase) mutation", "correct": false}, {"label": "B", "text": "Lymph node biopsy reveals depletion of follicles", "correct": false}, {"label": "C", "text": "Both Cell-mediated immunity & Humoral immunity are affected in this condition", "correct": true}, {"label": "D", "text": "Males are more commonly affected by X-linked agammaglobulinemia", "correct": false}], "correct_answer": "C. Both Cell-mediated immunity & Humoral immunity are affected in this condition", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both Cell-mediated immunity & Humoral immunity are affected in this condition</p>\n<p><strong>Highyeild:</strong></p><p>Bruton agammaglobulinemia or X-linked agammaglobulinemia (XLA) is an inherited immunodeficiency disorder characterised by the absence of mature B cells, resulting in severe antibody deficiency and recurrent infections.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. This child presentation suggestive of Bruton’s agammaglobulinemia (XLR inheritance) Option C. It is primarily a disease of humoral immunity. Cell-mediated immunity is not affected. Option D. Due to mutation in the gene coding for BTK, B-cell arrest occurs in the pre-B-cell stage. So, the child suffers from recurrent bacterial infections. Males are more commonly affected. Remaining all other options are characteristics of this disease.</p>\n<p><strong>Extraedge:</strong></p><p>XLA is an inherited immune disorder caused by an inability to produce B cells or the immunoglobulins (antibodies) that the B cells make. XLA is also called Bruton type agammaglobulinemia, X-linked infantile agammaglobulinemia, and congenital agammaglobulinemia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old male patient was admitted with complaints of persistent cough and sputum& cervical lymphadenopathy. He had been suffering from frequent upper and lower respiratory tract infections since his childhood. He had been operated on due to sinusitis and nasal polyposis 2 months ago. He was diagnosed with bronchiectasis 4 years ago. He was producing sputum between 5 and 10 cc a day, which was sometimes purulent. In addition, he had some constitutional symptoms such as fatigue, night sweats and weakness. He has recently completed a 1-week course of antibiotic therapy. There was no family history of immunological disorder, autoimmune or malignant disease, and social history was negative for alcohol and smoking. Physical examination reveals Blood pressure was 110/70 mmHg, heart rate was 80 beats/min, and body temperature was normal. There was no hepatosplenomegaly or lymphadenopathy. Pulmonary examination showed bilateral crackles and inspiratory-expiratory wheezing with auscultation of the back and the front side of the chest. The purified protein derivative (PPD) test was negative. Laboratory findings reveal White blood cell (WBC) 10,700 cells/mm 3 with polymorphonuclear leukocytes (PMNL) 68%, lymphocytes 22.7%, monocytes 5.5%, eosinophils 2.3%, basophils 0.6% and platelet counts were in normal ranges. Serum electrolytes, liver and renal function tests were normal. Anti-nuclear antibodies (ANA), anti-neutrophil cytoplasmic antibodies and human immunodeficiency virus (HIV) antibodies were negative. Hepatitis B and C markers were also negative. Ig tests showed low IgG = 145 (700-1600 mg/dL), IgA = 23 (70-400 mg/dL), IgM = 16 (40-230 mg/dL), IgG1 = 63 (200-1150 mg/dL), IgG2 = 10 (100-550 mg/dL), IgG3 = 13 (15-120 mg/dL), IgG = 4 (0-125 mg/dL) levels. lymph node biopsy reveals hyperplastic areas of immature B cells. which of the following is the most probable immunodeficient disorder associated with patients’ conditions?", "options": [{"label": "A", "text": "Bruton’s disease", "correct": false}, {"label": "B", "text": "Common variable immunodeficiency", "correct": true}, {"label": "C", "text": "Hyper IgM disease", "correct": false}, {"label": "D", "text": "Wiskott Aldrich syndrome", "correct": false}], "correct_answer": "B. Common variable immunodeficiency", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Common variable immunodeficiency Above mentioned features are suggestive of COVID. all the immunoglobulin levels are low. normal B- cell count is seen, but they cannot differentiate into plasma cells because of intrinsic B-cell defect, so there is no production of immunoglobulins.</p>\n<p><strong>Highyeild:</strong></p><p>Common variable immunodeficiency ( CVID ) is an immune disorder characterized by recurrent infections and low antibody levels, specifically in immunoglobulin (Ig) types IgG, IgM and IgA. [2] Symptoms generally include high susceptibility to foreign invaders, chronic lung disease, and inflammation and infection of the gastrointestinal tract. [2] CVID affects males and females equally. The condition can be found in children or teens but is generally not diagnosed or recognized until adulthood.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. As there is no family history and no atrophied lymph nodes in question, it’s not Bruton’s Option C. As IgM levels are low, not hyper IgM disease. Option D. Wiskott Aldrich syndrome has features like thrombocytopenia, eczema and infections. So, Options A, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>XLA is an inherited immune disorder caused by an inability to produce B cells or the immunoglobulins (antibodies) that the B cells make. XLA is also called Bruton type agammaglobulinemia, X-linked infantile agammaglobulinemia, and congenital agammaglobulinemia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 11-year-old male patient who had a generalised tonic seizure three days before the presentation was seen in the pediatric unit. He was born at term by vaginal delivery, weighing 3700 g. The developmental milestones were reported to be delayed. The patient walked at ˜2 years of age and uttered his first words at 2.5 years of age. He was offered physical therapy at that age by a pediatric neurologist. He was investigated for recurrent wheezing attacks at ˜4 years of age and was diagnosed to have gastroesophageal reflux (GER) and was treated accordingly. He underwent adenoidectomy, tonsillectomy and lacrimal canal dilatation. At 6 years of age, the patient had recurrent croup attacks and was treated with steroids. He was diagnosed to have Perthes disease at age ˜9 years. According to his family, his school performance was moderate. Their family history was unremarkable. Physical examination revealed a coarse facial appearance: small ears, a narrow forehead, and a long face with decreased ear creases. The voice was hypernasal. Chvostek and Trousseau signs were positive. Systemic findings were otherwise normal. He weighed 53 kg (0.9 SDS), measured 142 cm (−1.2 SDS) in height, and his body mass index (BMI) was 26.5 kg/m2 (4.5 SDS). He was pubertal with testicular volumes of 8 ml and pubic hair at stage 4. Laboratory investigations revealed hypocalcemia and hyperphosphatemia. Parathyroid hormone (PTH) level was low. Thyroid hormones, cortisol and prolactin levels were normal. Other biochemical parameters, blood count and urine analysis were normal. 24-hour urine calcium was 0.42 (mg/kg/day) (normal < 4 mg/kg/day). A diagnosis of hypoparathyroidism was considered. This diagnosis, suggested by the clinical and biochemical findings, was associated with 22q11.2 DS, which FISH showed as a heterozygote deletion. Further investigations revealed a normal echocardiography and normal B and T cell functions (not given in detail). The parents had normal FISH analysis, pointing to a sporadic mutation in our patient. Calcium replacement therapy, combined with active vitamin D, was started. Which of the following is the most probable diagnosis of the patient’s condition?", "options": [{"label": "A", "text": "Purine Nucleoside Phosphorylase deficiency", "correct": false}, {"label": "B", "text": "SCID", "correct": false}, {"label": "C", "text": "CVID", "correct": false}, {"label": "D", "text": "De George syndrome", "correct": true}], "correct_answer": "D. De George syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>De George syndrome Coarse facial features and hypocalcemia are suggestive of De George syndrome. It occurs due to the deletion of chromosome -22 q. Associated with 3rd and 4th pharyngeal arches defect, so underdeveloped parathyroid gland and thymus are seen.</p>\n<p><strong>Highyeild:</strong></p><p>A disorder caused by a defect in chromosome 22. DiGeorge syndrome is a chromosomal disorder that results in poor development of several bodily systems. Its features vary widely, even among members of the same family. The syndrome can cause heart defects, poor immune system function, a cleft palate and low calcium levels in the blood.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. PNP deficiency is a T-cell defect occurs due to defect in chromosome-14. Option B. SCID is a combined B&T cell defect occurs due to defect in DNA end joining repair Defect. Option C. CVID common variable immunodeficiency is an intrinsic B-cell defect. Options A, B and C are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>A disorder caused by a defect in chromosome 22. DiGeorge syndrome is a chromosomal disorder that results in poor development of several bodily systems. Its features vary widely, even among members of the same family. The syndrome can cause heart defects, poor immune system function, a cleft palate and low levels of calcium in the blood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 3½-year-old female child was referred to the paediatrician as a case of facial cellulitis with diffuse erythema and edema of the face and photophobia and watering from eyes of 1-month duration. The skin lesions were moderately pruritic; but painless. Constitutional symptoms were conspicuously absent. There was no history of recurrent respiratory or gastrointestinal infections. She had no other skin lesions. None of her family members were similarly affected. On clinical examination, the child had diffused erythema and edema extending from the forehead to the upper lip area. The erythematous face lesion was studded with pustules and crusting. There was no tenderness or local rise in temperature. She had oral mucosal lesions. Her nails were normal. Pus culture was sterile. Potassium hydroxide preparation of scrapings from the skin lesion examined under the microscope showed pseudohyphae and spores. Her serum immunoglobulin, complement level, and CD4 count were normal. Flow cytometry analysis of blood was not suggestive of any deficiency in T cells or B cells. which of the following is the probable diagnosis of the patient’s condition?", "options": [{"label": "A", "text": "CVID", "correct": false}, {"label": "B", "text": "Chediak Higashi syndrome", "correct": false}, {"label": "C", "text": "Job's syndrome", "correct": false}, {"label": "D", "text": "Chronic mucocutaneous candidiasis", "correct": true}], "correct_answer": "D. Chronic mucocutaneous candidiasis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chronic mucocutaneous candidiasis KOH mount showing pseudo hyphae suggestive of candida infection involving skin and mucosa. Her serum immunoglobulin, complement level, and CD4 count were normal, ruling out other immunodeficiency disorders. So the diagnosis is Chronic mucocutaneous Candidiasis.</p>\n<p><strong>Highyeild:</strong></p><p>Chronic mucocutaneous candidiasis is an immune disorder of T cells. [4] It is characterized by chronic infections with Candida that are limited to mucosal surfaces, skin, and nails. [5] : 310 It can also be associated with other infections, such as human papillomavirus. An association with chromosome 2 has been identified.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. CVID (common variable immunodeficiency) is a disease that occurs due to intrinsic defects in B-cells, so plasma cells are not formed, and all types of immunoglobulins will be absent or low. Option B. Chediak Higashi syndrome occurs due to LYST gene defect causing defective phagosome lysosome fusion. Option C. Jobs syndrome is an AD disorder due to a defect in STAT3 gene mutation; abnormal neutrophil chemotaxis due to decreased production of interferon-gamma by T-lymphocytes is thought to cause the disease.</p>\n<p><strong>Extraedge:</strong></p><p>A disorder caused by a defect in chromosome 22. DiGeorge syndrome is a chromosomal disorder that results in poor development of several bodily systems. Its features vary widely, even among members of the same family. The syndrome can cause heart defects, poor immune system function, a cleft palate and low levels of calcium in the blood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Patient A is a male infant who had a positive newborn screen for SCID in a US state which routinely performs newborn screening. He was born at 39 weeks gestational age via spontaneous vaginal delivery without prenatal or delivery complications. Around 3 h of life, he developed respiratory distress and required continuous positive pressure ventilation. His newborn screen for SCID with T cell receptor excision circles (TRECs) < 20 copies/μL suggested a SCID diagnosis. Which of the following statements are true regarding the patient’s condition except?", "options": [{"label": "A", "text": "X-linked inheritance is most commonly associated with the disease", "correct": false}, {"label": "B", "text": "It is associated with defects in both T cell & B cell defects", "correct": false}, {"label": "C", "text": "Adenosine deaminase deficiency is associated with an Autosomal variant of the disease", "correct": false}, {"label": "D", "text": "WASP gene defect is characteristic of the disease", "correct": true}], "correct_answer": "D. WASP gene defect is characteristic of the disease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>WASP gene defect is characteristic of the disease WASP gene defect is characteristic of Wiskott Aldrich syndrome.</p>\n<p><strong>Highyeild:</strong></p><p>Wiskott–Aldrich syndrome ( WAS ) is a rare X-linked recessive disease characterized by eczema, thrombocytopenia (low platelet count), immune deficiency, and bloody diarrhoea (secondary to the thrombocytopenia). [1] It is also sometimes called the eczema-thrombocytopenia-immunodeficiency syndrome, in keeping with Aldrich's original description in 1954. [2] The WAS-related disorders of X-linked thrombocytopenia (XLT) and X-linked congenital neutropenia (XLN) may present with similar but less severe symptoms and are caused by mutations of the same gene.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- All other options are features of SCID Option A. X-linked inheritance is most commonly associated with the disease - SCID Option B. It is associated with defects in both T cell & B cell defects, but mainly with T cells - SCID Option C. Adenosine deaminase deficiency is associated with an Autosomal variant of the disease - SCID</p>\n<p><strong>Extraedge:</strong></p><p>Wiskott-Aldrich syndrome is a rare genetic disorder of the immune system that primarily affects boys. It is characterized by abnormal immune function and a reduced ability to form blood clots.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 7-year-old boy was referred to allergy clinic with complaints of wheezing, dry skin and infection. He was the first child born to consanguineous parents. At age 2, he was hospitalized for the first time with high-grade fever due to a severe cold, followed by respiratory distress and ecchymosis. PLT count was 30000/mL. A bone marrow biopsy was performed to evaluate the underlying etiology of thrombocytopenia. Idiopathic thrombocytopenic purpura (ITP) and asthma were diagnosed, and he was treated with prednisolone and oral beclomethasone spray. From the age of 3 to 6, he suffered from asthma attacks and was admitted to ICU several times. Also, he developed generalised eczema when he was 6 years old. Two of his uncles reportedly died in childhood after experiencing similar symptoms. Physical examination revealed generalized eczema and normal growth. Laboratory tests showed microcytic thrombocytopenia with a PLT count of 30000/mL and WBC 6000/ml with 50% neutrophils, 38% lymphocytes and 5% eosinophils. which of the following is the most probable diagnosis of the patient’s medical condition?", "options": [{"label": "A", "text": "Wiskott-Aldrich syndrome", "correct": true}, {"label": "B", "text": "Severe combined immune deficiency", "correct": false}, {"label": "C", "text": "Ataxia telangiectasia", "correct": false}, {"label": "D", "text": "Chediak-Higashi syndrome", "correct": false}], "correct_answer": "A. Wiskott-Aldrich syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Wiskott-Aldrich syndrome Eczema, thrombocytopenia and recurrent infections suggestive of Wiskott-Aldrich syndrome.</p>\n<p><strong>Highyeild:</strong></p><p>Wiskott–Aldrich syndrome ( WAS ) is a rare X-linked recessive disease characterized by eczema, thrombocytopenia (low platelet count), immune deficiency, and bloody diarrhea (secondary to the thrombocytopenia). [1] It is also sometimes called the eczema-thrombocytopenia-immunodeficiency syndrome, in keeping with Aldrich's original description in 1954. [2] The WAS-related disorders of X-linked thrombocytopenia (XLT) and X-linked congenital neutropenia (XLN) may present with similar but less severe symptoms and are caused by mutations of the same gene.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. Chediak Higashi syndrome occurs due to an LYST gene defect causing defective phagosome lysosome fusion. Option B. SCID is a combined B & t cell defect that occurs due to a defect in DNA end-joining repair defect. Option C. Ataxia telangiectasia is characterised by kinase enzyme deficiency and ATM ataxia telangiectasia gene defect. The patient presents with conjunctival telangiectasias and cerebellar lesions. So, Option B, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Wiskott-Aldrich syndrome is a rare genetic disorder of the immune system that primarily affects boys. It is characterized by abnormal immune function and a reduced ability to form blood clots.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-months-old Sudanese boy presented with delayed walking (20 months), unsteady gait and frequent falls, and delayed slurred speech. He had recurrent respiratory and ear infections associated with psychomotor delay, but his somatic growth was normal. On examination, he showed florid bulbar conjunctiva telangiectasia. Movement patterns demonstrated ataxia but no extrapyramidal movements or ocular apraxia. Magnetic resonance image (MRI) showed cerebellar atrophy. Investigations revealed low lymphocyte count and IgA. Alpha-fetoprotein (AFP) testing was not available. The child was treated symptomatically and supportively with antibiotics for recurrent infections and multivitamins. Speech therapy was advised, and intravenous immunoglobulin therapy was suggested, but could not be afforded by the family. The coronary MRI Image is given below. which of the following is the most probable diagnosis of the patient’s condition, which is associated with Kinase enzyme deficiency?", "options": [{"label": "A", "text": "Ataxia Telangiectasia", "correct": true}, {"label": "B", "text": "Wiskott Aldrich syndrome", "correct": false}, {"label": "C", "text": "Chediak Higashi syndrome", "correct": false}, {"label": "D", "text": "Bruton’s disease", "correct": false}], "correct_answer": "A. Ataxia Telangiectasia", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245691873-QTDV047013IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ataxia Telangiectasia Ataxia telangiectasia is characterized by kinase enzyme deficiency and ATM ataxia telangiectasia gene defect. The patient presents with conjunctival telangiectasias and cerebellar lesions.</p>\n<p><strong>Highyeild:</strong></p><p>Ataxia–telangiectasia ( AT or A–T ), also referred to as ataxia–telangiectasia syndrome or Louis–Bar syndrome , [1] is a rare, neurodegenerative, autosomal recessive disease causing severe disability. Ataxia refers to poor coordination, and telangiectasia to small dilated blood vessels, both of which are hallmarks of the disease. [2] A–T affects many parts of the body: It impairs certain areas of the brain, including the cerebellum, causing difficulty with movement and coordination. It weakens the immune system, causing a predisposition to infection. It prevents the repair of broken DNA, increasing the risk of cancer. Ataxia Telangiectasia Characterized by: Cerebellar deterioration Oculocutaneous telangiectasia Immunodeficiency Genomic Instability Acute sensitivity to ionizing radiation Predisposition to malignancy</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Chediak Higashi syndrome occurs due to LYST gene defect causing defective phagosome lysosome fusion. Option C. Wiskott Aldrich syndrome has features like thrombocytopenia, eczema and infections Option D. In Bruton’s arrest of B-cells in the pre-B-cell phase so there will be no plasma cells and all types of immunoglobulins will be low. So, Options B, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Wiskott-Aldrich syndrome is a rare genetic disorder of the immune system that primarily affects boys. It is characterized by abnormal immune function and a reduced ability to form blood clots.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 2-year-old girl with history of recurrent infections since her birth presented with persistent pneumonia. On admission, physical examination revealed mild cOptionsetraction and rales in both lung fields. She was alert and responsive, with no neurological deficit. Her height and weight were at the 25th-50th percentile and the 50th-75th percentile for her age, respectively. which of the following conditions is associated with a deficiency in NADPH oxidase enzyme resulting in recurrent infections of Catalase-positive organisms?", "options": [{"label": "A", "text": "Chronic Granulomatous Disease", "correct": true}, {"label": "B", "text": "Chediak Higashi syndrome", "correct": false}, {"label": "C", "text": "Wiskott Aldrich syndrome", "correct": false}, {"label": "D", "text": "Bruton’s disease", "correct": false}], "correct_answer": "A. Chronic Granulomatous Disease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chronic Granulomatous Disease Deficiency of NADPH oxidase is suggestive of Chronic Granulomatous Disease It is associated with recurrent infections mainly with catalase-positive organisms</p>\n<p><strong>Highyeild:</strong></p><p>Chronic granulomatous disease ( CGD ), also known as Bridges–Good syndrome , chronic granulomatous disorder , and Quie syndrome , [1] is a diverse group of hereditary diseases in which certain cells of the immune system have difficulty forming the reactive oxygen compounds (most importantly the superoxide radical due to defective phagocyte NADPH oxidase) used to kill certain ingested pathogens. [2] This leads to the formation of granulomas in many organs</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Chediak Higashi syndrome occurs due to LYST gene defect causing defective phagosome lysosome fusion Option C. Eczema, thrombocytopenia and recurrent infections suggestive of wiskott Aldrich syndrome Option D. In Bruton’s arrest of B-cells in pre-B-cell phase so there will be no plasma cells all types of immunoglobulins will be low So, Option B, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Bruton agammaglobulinemia, also known as X-linked agammaglobulinemia (XLA) or Bruton's agammaglobulinemia, is an inherited immunodeficiency disorder. It is characterized by the absence of mature B cells which in turn leads to severe antibody deficiency and recurrent infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 5-year-old boy child, born out of a first-degree consanguineous marriage, presented with the history of fever, bilateral neck swellings and loss of appetite. On examination, pallor, silvery gray hair, oculocutaneous albinism was observed. Generalised lymphadenopathy and hepatosplenomegaly were also noted. Subsequently, a complete blood count showed a hemoglobin count of 8.6 g/dL and a total WBC count of 22.1 × 103/uL, with lymphocytes showing single large round to oval purple-coloured intracytoplasmic granules & giant platelets. Which of the following is the most probable diagnosis associated with defective phagosome-lysosome fusion?", "options": [{"label": "A", "text": "Wiskott-Aldrich syndrome", "correct": false}, {"label": "B", "text": "Chediak- Higashi syndrome", "correct": true}, {"label": "C", "text": "Chronic granulomatous disease", "correct": false}, {"label": "D", "text": "Common variable immune deficiency", "correct": false}], "correct_answer": "B. Chediak- Higashi syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chediak- Higashi syndrome Chediak Higashi syndrome occurs due to an LYST gene defect causing defective phagosome lysosome fusion.it is characterised by albinism nerve defects and bleeding.</p>\n<p><strong>Highyeild:</strong></p><p>Chédiak–Higashi syndrome [1] ( CHS ) is a rare autosomal recessive disorder that arises from a mutation of a lysosomal trafficking regulator protein, [2] which leads to a decrease in phagocytosis. Decreased phagocytosis results in recurrent pyogenic infections, albinism, and peripheral neuropathy. In Chédiak–Higashi syndrome, the lysosomal trafficking regulator (LYST) gene is mutated, disrupting protein synthesis and the storage and secretory function of lysosomal granules in white blood cells. [3] This results in defective white blood cell function with enlarged vesicles. This syndrome also leads to neutropenia and phagocyte bactericidal dysfunction due to impaired chemotaxis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Eczema, thrombocytopenia and recurrent infections suggestive of wiskott Aldrich syndrome Option C. CGD immunodeficiency disorder occur due to a defect in NADPH oxidase. It is associated with recurrent infections, mainly with catalase-positive Option D. CVID is a disease that occurs due to intrinsic defects in B-cells, so plasma cells are not formed, and all types of immunoglobulins will be absent or low. So, Options A, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Bruton agammaglobulinemia, also known as X-linked agammaglobulinemia (XLA) or Bruton's agammaglobulinemia, is an inherited immunodeficiency disorder. It is characterized by the absence of mature B cells which in turn leads to severe antibody deficiency and recurrent infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 11-year-old-boy is presented with a coarse facial appearance, pruritic dermatitis, recurrent skin abscesses, pulmonary infection, a reduced rate of resorption of the roots of primary teeth and an elevated serum IgE concentration. The colonization of Candida albicans, Klebsiella pneumoniae, Escherichia coli and Staphylococcus aureus were found. The above features are most consistent with which of the following conditions?", "options": [{"label": "A", "text": "CVID", "correct": false}, {"label": "B", "text": "SCID", "correct": false}, {"label": "C", "text": "Job's syndrome", "correct": true}, {"label": "D", "text": "Chediak higashi syndrome", "correct": false}], "correct_answer": "C. Job's syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Job's syndrome Job's syndrome is an AD disorder due to a defect in STAT3 gene mutation. abnormal neutrophil chemotaxis due to decreased production of interferon-gamma by T-lymphocytes is thought to cause the disease.</p>\n<p><strong>Highyeild:</strong></p><p>It is characterized by recurrent \"cold\" staphylococcal infections (due to impaired recruitment of neutrophils), [2] unusual eczema-like skin rashes. These severe lung infections result in pneumatoceles (balloon-like lesions that may be filled with air or pus or scar tissue) and very high (> 2000 IU/mL or 4800 mcg/L) [3] concentrations of the serum antibody IgE. Inheritance can be autosomal dominant or autosomal recessive. [4] Many patients with autosomal dominant STAT3 hyper-IgE syndrome have characteristic facial and dental abnormalities, fail to lose their primary teeth, and have two sets of teeth simultaneously</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. CVID is a disease that occurs due to intrinsic defect in B-cells. So plasma cells are not formed, and all types of immunoglobulins will be absent or low. Option A. SCID is a combined B & T cell defect that occurs due to a defect in DNA end-joining repair defect. Option D. Chediak Higashi syndrome occurs due to an LYST gene defect causing defective phagosome. lysosome fusion.it is characterised by albinism nerve defects and bleeding. So, Option B, A and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Job Syndrome (Hyper-IgE syndrome) is a rare, primary immunodeficiency distinguished by the clinical triad of atopic dermatitis, recurrent skin staphylococcal infections, and recurrent pulmonary infections. The disease is characterized by elevated IgE levels with an early onset in primary childhood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following complement protein deficiency is associated with the below condition?", "options": [{"label": "A", "text": "C1, C2& C3", "correct": true}, {"label": "B", "text": "C5b,6,7,8,9", "correct": false}, {"label": "C", "text": "C1 esterase", "correct": false}, {"label": "D", "text": "Factor I /H", "correct": false}], "correct_answer": "A. C1, C2& C3", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245700393-QTDV047017IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C1, C2& C3 The clinical picture depicts malar rash, alopecia, Raynaud’s phenomenon c1 c2 c3 complement deficiency is associated with systemic lupus erythematosus</p>\n<p><strong>Highyeild:</strong></p><p>The complement system involves both the innate and the adaptive immune systems and has important roles in the pathogenesis of SLE. Complement deficiencies within the classical pathway (C1q, C4 and C2) of activation predispose to the development of the autoimmune disease SLE.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. C5b,6,7,8,9 deficiency is associateOptions recurrent Neisseria infections Option C. C1 esterase deficiency is associated with hereditary angioedema or Quincke’s disease. Option D. Factor I/H deficiency is associated with pyogenic infections. So, Options B, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Job Syndrome (Hyper-IgE syndrome) is a rare, primary immunodeficiency distinguished by the clinical triad of atopic dermatitis, recurrent skin staphylococcal infections, and recurrent pulmonary infections. The disease is characterized by elevated IgE levels with an early onset in primary childhood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old female presented with fever and generalised malaise to a rural hospital in Ghana. The patient was previously diagnosed with enteric fever from a neighbouring health facility. Blood and urine samples were collected from the patient and cultured using standard microbiological and molecular techniques. Neisseria gonorrhoeae was isolated from the blood resistant to penicillin, ciprofloxacin and cotrimoxazole. The patient recovered following ceftriaxone and azithromycin treatment. which of the following complement protein deficiency is associated with recurrent gonorrheal infection?", "options": [{"label": "A", "text": "C1, C2& C3", "correct": false}, {"label": "B", "text": "C5b,6,7,8,9", "correct": true}, {"label": "C", "text": "C1 esterase", "correct": false}, {"label": "D", "text": "Decay accelerating factor", "correct": false}], "correct_answer": "B. C5b,6,7,8,9", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C5b,6,7,8,9 C5b,6,7,8,9 deficiency is associated with recurrent Neisseria infections</p>\n<p><strong>Highyeild:</strong></p><p>Which complement deficiency causes Neisseria? Recurrent Neisseria infection indicates possible late complement deficiencies (C5-C9) and early alternative pathway (properdin) deficiency. Severe recurrent pyogenic infection early in life should be an indication to rule out C3 immunodeficiency.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. C1, C2& C3 complement deficiency is associated with systemic lupus erythematosus Option C. C1 esterase deficiency is associated with hereditary angioedema or Quincke’s disease Option D. Decay accelerating factor (CD55 and CD59) is associated with So, Option A, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Complement deficiencies are primary immunodeficiencies that cause various clinical scenarios depending on the specific complement protein that is deficient. This can include an increased risk of a wide range of infectious as well as local or systemic inflammatory and thrombotic conditions.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following complement deficiency is associated with the following clinical condition?", "options": [{"label": "A", "text": "C1, C2& C3", "correct": false}, {"label": "B", "text": "C5b,6,7,8,9", "correct": false}, {"label": "C", "text": "C1 esterase", "correct": true}, {"label": "D", "text": "Decay accelerating factor", "correct": false}], "correct_answer": "C. C1 esterase", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245704537-QTDV047019IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C1 esterase C1 esterase deficiency is associated with hereditary angioedema or Quincke’s disease, which presents as lip swelling.</p>\n<p><strong>Highyeild:</strong></p><p>Hereditary angioedema (HAE) is an autosomal dominant disease caused by either a lack of C1-inhibitor or dysfunctional C1-inhibitor protein. HAE manifests with symptoms of angioedema of the upper airway, skin, and/ or gastrointestinal tract.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. Decay accelerating factor (CD55 and CD59) is associated with PNH Option B. C5b,6,7,8,9 deficiency is associated with recurrent Neisseria infections Option A. C1, C2 and C3 deficiency are associated with lupus. So, Options B, A and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Complement deficiencies are primary immunodeficiencies that cause various clinical scenarios depending on the specific complement protein that is deficient. This can include an increased risk of a wide range of infectious as well as local or systemic inflammatory and thrombotic conditions.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old Caucasian woman presented to her primary-care physician for evaluation of new tea-coloured urine noticed intermittently over the past five days. Her last menstrual cycle was two weeks ago, and they have been occurring regularly. There is no history of renal stones, NSAID abuse, weight loss, night sweats, fever, melena, or hemoptysis. Her vital signs were unremarkable. On initial evaluation, CBC, urinalysis, and renal ultrasound were normal, and the urine pregnancy test was negative. A few days later, she developed jaundice with abdominal pain. Repeat testing at that time showed the following: WBC count 3600/mm3, haemoglobin 4 g/dL, platelet count 189,000/ mm3, MCV 75 fl, RDW 28, reticulocyte count 10.9 per cent (N.V.= 0.5-2.3%), total serum bilirubin 7.5 mg/dL (N.V.= 0.10-1.2 mg/dL), indirect bilirubin 5.5 mg/dL (N.V.= 0.10-1.0 mg/dL), AST 213 U/L serum LDH 1500 U/L (nv= 259-613), serum haptoglobin < 10 mg/dL. The urinalysis showed hemoglobinuria. The Direct Coombs test is negative. Liver ultrasound shows mild hepatomegaly and no signs of stones, biliary ductal dilatation, or hepatic mass. Flow cytometry of peripheral blood smear was performed. which of the complement protein defect is suspected in the above patient?", "options": [{"label": "A", "text": "Absent expression of CD 55 and CD 59(DAF)", "correct": true}, {"label": "B", "text": "Absent expression of C1, C2 & C3", "correct": false}, {"label": "C", "text": "Absent expression of C5b,6,7,8,9", "correct": false}, {"label": "D", "text": "Absent expression of C1 esterase", "correct": false}], "correct_answer": "A. Absent expression of CD 55 and CD 59(DAF)", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245706674-QTDV047020IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Absent expression of CD 55 and CD 59(DAF) Decay accelerating factor (CD55 and CD59) is associated with PNH.</p>\n<p><strong>Highyeild:</strong></p><p>Paroxysmal nocturnal hemoglobinuria ( PNH ) is a rare, acquired, [1] life-threatening disease of the blood characterised by the destruction of red blood cells by the complement system, a part of the body's innate immune system. This destructive process occurs due to the red blood cell surface protein DAF deficiency, which normally inhibits such immune reactions. Since the complement cascade attacks, the red blood cells within the circulatory system's blood vessels, red blood cell destruction (hemolysis) is considered an intravascular hemolytic anaemia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. C1, C2& C3 complement deficiency is associated with systemic lupus erythematosus Option D. C1 esterase deficiency is associated with hereditary angioedema or Quincke’s disease Option C. C3 complement deficiency is associated with complement mediated glomerulonephritis.</p>\n<p><strong>Extraedge:</strong></p><p>PNH is caused by a somatic mutation in PIGA that leads to a marked deficiency or absence of the complement regulatory proteins CD55 and CD59. The disease manifests with intravascular hemolysis, bone marrow failure, and thrombosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The clinical pictures below are most consistent with which of the following medical conditions?", "options": [{"label": "A", "text": "Wiskott-Aldrich syndrome", "correct": false}, {"label": "B", "text": "Chediak- Higashi syndrome", "correct": true}, {"label": "C", "text": "Chronic granulomatous disease", "correct": false}, {"label": "D", "text": "Common variable immune deficiency", "correct": false}], "correct_answer": "B. Chediak- Higashi syndrome", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245710801-QTDV047021IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chediak- Higashi syndrome Chediak Higashi syndrome occurs due to a LYST gene defect causing defective phagosome lysosome fusion.it is characterized by albinism, nerve defects and bleeding.</p>\n<p><strong>Highyeild:</strong></p><p>Chédiak–Higashi syndrome [1] ( CHS ) is a rare autosomal recessive disorder that arises from a mutation of a lysosomal trafficking regulator protein, [2] which leads to a decrease in phagocytosis. The decrease in phagocytosis results in recurrent pyogenic infections, albinism, and peripheral neuropathy. In Chédiak–Higashi syndrome, the lysosomal trafficking regulator (LYST) gene is mutated, leading to disruption of protein synthesis as well as the storage and secretory function of lysosomal granules in white blood cells. [3] This results in defective white blood cell function with enlarged vesicles. This syndrome also leads to neutropenia and phagocyte bactericidal dysfunction due to impaired chemotaxis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. CVID is a disease that occurs due to intrinsic defects in B-cells. So plasma cells are not formed, and all types of immunoglobulins will be absent or low. Option A. Eczema, thrombocytopenia and recurrent infections suggestive of wiskott Aldrich syndrome Option C. CGD Candida Genome Database immunodeficiency disorder occurs due to a defect in NADPH oxidase. It is associated with recurrent infections, mainly with catalase-positive organisms So Options A, C and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Chédiak-Higashi syndrome is a rare, autosomal recessive immunodeficiency disorder characterized by impaired lysis of phagocytized bacteria, resulting in recurrent bacterial respiratory and other infections and oculocutaneous albinism. Genetic testing for LYST mutations can confirm the diagnosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The clinical pictures below are most consistent with which of the following medical conditions?", "options": [{"label": "A", "text": "Wiskott-Aldrich syndrome", "correct": true}, {"label": "B", "text": "Chediak- Higashi syndrome", "correct": false}, {"label": "C", "text": "Chronic granulomatous disease", "correct": false}, {"label": "D", "text": "Common variable immune deficiency", "correct": false}], "correct_answer": "A. Wiskott-Aldrich syndrome", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245716974-QTDV047022IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Wiskott-Aldrich syndrome Eczema, thrombocytopenia and recurrent infections suggestive of wiskott Aldrich syndrome.</p>\n<p><strong>Highyeild:</strong></p><p>Wiskott–Aldrich syndrome ( WAS ) is a rare X-linked recessive disease characterized by eczema, thrombocytopenia (low platelet count), immune deficiency, and bloody diarrhoea (secondary to the thrombocytopenia). [1] It is also sometimes called the eczema-thrombocytopenia-immunodeficiency syndrome, in keeping with Aldrich's original description in 1954. [2] The WAS-related disorders of X-linked thrombocytopenia (XLT) and X-linked congenital neutropenia (XLN) may present wicharacterisedt less severe symptoms and are caused by mutations of the same gene.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Chediak Higashi syndrome occurs due to LYST gene defect causing defective phagosome lysosome fusion.albinism nerve defects and bleeding characterise it. Option D. CVID is a disease that occurs due to intrinsic defects in B-cells. So plasma cells are not formed, and all immunoglobulins will be absent or low. Option C. CGD immunodeficiency disorder occurs due to a defect in NADPH oxidase. It is associated with recurrent infections, mainly with catalase-positive organisms So Options B, C and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Match the following Immunodeficiency diseases with the characteristics. Select the correct option from the given below code:", "options": [{"label": "A", "text": "A-IV; B-III; C-II, D-I", "correct": true}, {"label": "B", "text": "A-IV; B-II; C-III, D-I", "correct": false}, {"label": "C", "text": "A-IV; B-III; C-I, D-II", "correct": false}, {"label": "D", "text": "A-I; B-III; C-II, D-IV", "correct": false}], "correct_answer": "A. A-IV; B-III; C-II, D-I", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689245719271-QTDV047023IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A-IV; B-III; C-II, D-I Chediak Higashi syndrome occurs due to LYST gene defect causing defective phagosome lysosome fusion. albinism, nerve defects and bleeding characterise it.</p>\n<p><strong>Highyeild:</strong></p><p>Chédiak–Higashi syndrome ( CHS ) is a rare autosomal recessive disorder that arises from a mutation of a lysosomal trafficking regulator protein, [2] which leads to a decrease in phagocytosis. Decreased phagocytosis results in recurrent pyogenic infections, albinism, and peripheral neuropathy. In Chédiak–Higashi syndrome, the lysosomal trafficking regulator (LYST) gene is mutated, disrupting protein synthesis and the storage and secretory function of lysosomal granules in white blood cells. [3] This results in defective white blood cell function with enlarged vesicles. This syndrome also leads to neutropenia and phagocyte bactericidal dysfunction due to impaired chemotaxis. CGD immunodeficiency disorder occurs due to a defect in NADPH oxidase. It is associated with recurrent infections mainly with catalase-positive organisms Eczema, thrombocytopenia and recurrent infections suggestive of wiskott Aldrich syndrome associated with gene mutation Bruton’s disease is due to mutation in the gene coding for BTK arrest of B-cells occur in the pre-B-cell stage. So, the child suffers from recurrent bacterial infections.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- All the other options are wrong match.</p>\n<p><strong>Extraedge:</strong></p><p>Chédiak-Higashi syndrome is a rare, autosomal recessive immunodeficiency disorder characterized by impaired lysis of phagocytized bacteria, resulting in recurrent bacterial respiratory and other infections and oculocutaneous albinism. Genetic testing for LYST mutations can confirm the diagnosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Rheumatoid arthritis, the body's immune system attacks its tissue, including joints. In severe cases, it attacks internal organs. Rheumatoid arthritis affects joint linings, causing painful swelling. Over long periods, the inflammation associated with rheumatoid arthritis can cause bone erosion and joint deformity. While there's no cure for rheumatoid arthritis, physiotherapy and medication can help slow the disease's progression. Rheumatoid arthritis is best diagnosed by:", "options": [{"label": "A", "text": "Anticitrulline antibody", "correct": true}, {"label": "B", "text": "IgG antibody", "correct": false}, {"label": "C", "text": "IgA antibody", "correct": false}, {"label": "D", "text": "None of these", "correct": false}], "correct_answer": "A. Anticitrulline antibody", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anticitrulline antibody Anticitrulline antibodies:- Autoantibodies that are frequently detected in the blood of rheumatoid arthritis patients.</p>\n<p><strong>Highyeild:</strong></p><p>Research suggests that in the joints of patients with rheumatoid arthritis, proteins may be changed to citrulline as part of the process that leads to rheumatoid joint inflammation. When the citrulline antibody is found in a patient’s blood, there is a 90-95% likelihood that the patient has rheumatoid arthritis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B, C & D. Rheumatoid arthritis is also diagnosed by detecting RF (Rheumatoid factor) RF is an IgM antibody directed against the Fc portion of the IgG antibody. passive agglutination tests like Rose detect RF- waaler test & Latex agglutination text</p>\n<p><strong>Extraedge:</strong></p><p>Rheumatoid arthritis (RA) is characterized by the presence of autoantibodies like rheumatoid factor (RF), anti-cyclic citrullinated peptide-2 (anti-CCP2), and anti-carbamylated protein (anti-CarP) antibodies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 31 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "The person shown in the Image prepared a vaccine for which of the following disease?", "options": [{"label": "A", "text": "Rabies", "correct": false}, {"label": "B", "text": "Anthrax", "correct": false}, {"label": "C", "text": "Smallpox", "correct": true}, {"label": "D", "text": "Plague", "correct": false}], "correct_answer": "C. Smallpox", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1690897394337-QTDV033001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Smallpox The smallpox vaccine, introduced by Edward Jenner in 1796, was the first successful vaccine to be developed. He observed that milkmaids who previously had caught cowpox did not catch smallpox and showed that inoculated vaccinia protected against inoculated variola virus. Smallpox is an acute contagious disease caused by the variola virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Rabies Vaccine was created by Louis Pasteur and émile Roux in 1885 Option: B. Anthrax vaccine is based on the classic experiments of Louis Pasteur. Option: D. Bacteriologist Waldemar Haffkine developed First plague vaccine</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Contributions of the scientist shown in the Image include all except:", "options": [{"label": "A", "text": "Staining methods", "correct": true}, {"label": "B", "text": "Rabies vaccine", "correct": false}, {"label": "C", "text": "Germ theory", "correct": false}, {"label": "D", "text": "Principles of sterilization", "correct": false}], "correct_answer": "A. Staining methods", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1690897398561-QTDV033002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Staining methods Louis Pasteur is best known for inventing the process that bears his name, pasteurization. Pasteurization kills microbes and prevents spoilage in beer, milk, and other goods. While studying rabies, Pasteur tested his first human vaccine. Pasteur produced the vaccine by attenuating the virus in rabbits and harvesting it from their spinal cords. His most important work was the discovery of food pasteurization (sterilization) and the development of vaccines.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. These were all discovered by Louis Pasteur. Louis Pasteur –French chemist and microbiologist. Vaccines for cholera, rabies, and anthrax. John Snow – English physician. Development of anesthesia and medical hygiene. Paul Ehrlich – German physician. I am known for chemotherapy, cure for syphilis, precursor technique for gram staining, magic bullet, and anti-serum for diphtheria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Steps of gram stain sequence arrangement: Mordant -Iodine treatment Safranin Crystal/Gentian Violet Alcohol wash Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1>2>3>4", "correct": false}, {"label": "B", "text": "2>3>1>4", "correct": false}, {"label": "C", "text": "3>1>4>2", "correct": true}, {"label": "D", "text": "2>1>4>3", "correct": false}], "correct_answer": "C. 3>1>4>2", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>3>1>4>2 3. Crystal/Gentian Violet 1. Mordant –Iodine treatment 4. Alcohol wash 2. Safranin There are four basic steps of the Gram stain: 1. Applying a primary stain (crystal violet) to a heat-fixed smear of a bacterial culture. 2. The addition of iodide, which binds to crystal violet and traps it in the cell. 3. Rapid decolorization with ethanol or acetone. 4. Counterstaining with safranin</p>\n<p><strong>Highyeild:</strong></p><p>Remember In Gram stain: Under decolorization: Everything will look gram-positive (violet) Over decolorization: Everything will look gram-negative (pink) Heating (Intermittent heating) is done in acid-fast stain (not for gram stain)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following helps in bacterial adhesion?", "options": [{"label": "A", "text": "Cytoplasmic membrane", "correct": false}, {"label": "B", "text": "Mesosomes", "correct": false}, {"label": "C", "text": "Fimbriae", "correct": true}, {"label": "D", "text": "LPS Lipopolysaccharide", "correct": false}], "correct_answer": "C. Fimbriae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Fimbriae Many Gram-negative and some Gram-positive bacteria possess short, delicate, hair-like appendages that are thinner than flagella and not involved in motility, called fimbriae or pili. They measure 0.5 µm long and 10 nm in thickness: Are made up of protein called pilin Are antigenic; however, the antibodies against fimbrial antigens are not protective.</p>\n<p><strong>Highyeild:</strong></p><p>Functions: Fimbriae are called the organ of adhesion. This property enhances the virulence of bacteria. Certain fimbriae called sex pili also help in bacterial gene transfer. Fimbriae are unrelated to motility and can be found in motile and nonmotile organisms. Types Common pili: There are six types Sex or F (fertility) pili: Help in bacterial conjugation, e.g., as found in Gonococcus Col I (colicin) pili</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. The cytoplasmic membrane is a fluid phospholipid bilayer embedded with proteins and glycoproteins; It protects the interior contents of a bacterial cell. Option B. Mesosome is an organelle in DNA replication and guides the distribution of duplicated bacterial chromosomes into two daughter cells during cell division. They also carry the enzymes for aerobic respiration and increase the surface area. Option D. LPS helps maintain the barrier function, preventing the diffusion of hydrophobic solutes such as antibiotics and detergents into the cell.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is wrong about fathers:", "options": [{"label": "A", "text": "Microbiology - Louis Pasteur", "correct": false}, {"label": "B", "text": "Vaccinology - Edward Jenner", "correct": false}, {"label": "C", "text": "Epidemiology - John Snow", "correct": false}, {"label": "D", "text": "Antiseptic surgery - Paul Ehrlich", "correct": true}], "correct_answer": "D. Antiseptic surgery - Paul Ehrlich", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antiseptic surgery - Paul Ehrlich J oseph Lister published his first paper in the BMJ in 1867 and carried on publishing in the journal for over 40 years. Lister is the father of antiseptic surgery, and his pioneering techniques transformed the survival rates of patients. Joseph Lister discovered that carbolic spray effectively stopped wounds from getting gangrene. He developed antiseptic surgery by spraying medical instruments, catgut, and bandages with a 1-in-20 solution of carbolic acid.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. All options are correct Louis Pasteur was a French chemist and microbiologist. Vaccines for cholera, rabies, and anthrax. She was known as the father of microbiology, along with Robert Koch. John Snow – English physician. Development of anesthesia and medical hygiene. Paul Ehrlich – German physician. I am known for chemotherapy, cure for syphilis, precursor technique for gram staining, magic bullet, and anti-serum for diphtheria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the test shown in Image?", "options": [{"label": "A", "text": "E-test", "correct": false}, {"label": "B", "text": "Quantiferon", "correct": false}, {"label": "C", "text": "Stoke's method", "correct": true}, {"label": "D", "text": "ELISA enzyme-linked immunosorbent assay", "correct": false}], "correct_answer": "C. Stoke's method", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1690897403059-QTDV033006IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Stoke's method The Stokes' method allows each isolate to be compared with an ATCC control strain subjected to the same technical conditions of medium, incubation time, atmosphere, temperature, and disc content. It is an antibiotic-sensitivity method. A plastic strip impregnated with different concentrations of antibiotics is placed on a growth medium, and the growth medium is viewed after incubation. The minimum inhibitory concentration can be identified based on the intersection of the teardrop-shaped zone of inhibition with the marking on the strip.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. E-test determines the MIC of antibiotics and antifungal agents. A predefined gradient of antibiotic concentrations immobilized on a plastic strip i s used. Option: B. QuantiFERON is a simple blood test that aids in detecting M. tuberculosis. It is used for the detection of latent Tuberculosis. Option: D. ELISA – enzyme-linked immunoassay is a serological test to detect antibodies in the blood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "While joining the department, your HOD asked you some microbiology questions. And one of his questions was, what are the various methods of identification of a causative agent in microbiology? The correct options for the above question is/are?", "options": [{"label": "A", "text": "Routine staining and culture method", "correct": false}, {"label": "B", "text": "Molecular method", "correct": false}, {"label": "C", "text": "Immunological method", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above In microbiology, various methods of identification of a causative agent are routine, including staining for direct microscopy and culture and molecular and immunological techniques. So, all options are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following option describes the correct step in the routine identification method of causative agent?", "options": [{"label": "A", "text": "Culture → microscopy → Identification", "correct": false}, {"label": "B", "text": "Microscopy → Culture → Identification", "correct": true}, {"label": "C", "text": "Identification → Culture → Microscopy", "correct": false}, {"label": "D", "text": "Microscopy → Identification → Culture", "correct": false}], "correct_answer": "B. Microscopy → Culture → Identification", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Microscopy → Culture → Identification In the routine method of identification of a causative agent, microscopy is first done. Then the agent is cultured in the culture media to identify the agent quickly. So correct sequence is shown in option B</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. These steps are not in the appropriate order for identification of the causative agent</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A pus sample was sent to the microbiology lab for processing. While doing the routine method of identification of a causative agent, why is microscopy necessary before doing the culture of an organism?", "options": [{"label": "A", "text": "For the selection of cultural media", "correct": true}, {"label": "B", "text": "For selecting the power of microscope used", "correct": false}, {"label": "C", "text": "To reduce the cost of identification", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. For the selection of cultural media", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>For the selection of cultural media Microscopy is done to select the type of media in which the organism can be cultured. So, by performing microscopy, one can know which culture media should be used. For example, we can use bacterial culture media for bacteria or fungi or fungal culture media. So the correct answer is A.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. Other options are not determined by microscopy—the correct explanation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 34-year-old male presented to the OPD with the complaint of productive cough for the last two weeks. He also said that he feels feverish by the time evening arises. The doctor ordered a sputum examination for the patient, and the sputum microscopic examination revealed mycobacteria. He was started on ATT. The patient came back after one month, complaining that his symptoms were not subsiding and he was not seeing any improvement. Which gene is responsible for rifampicin resistance in mycobacteria?", "options": [{"label": "A", "text": "Rpo-B gene", "correct": true}, {"label": "B", "text": "Mec A", "correct": false}, {"label": "C", "text": "Mec C", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Rpo-B gene", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rpo-B gene The rpo-B gene is involved in rifampicin resistance in mycobacteria. So the correct answer is A</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Mec A gene is involved in methicillin resistance in Staphylococcus aureus. Option: C. Mec C gene is also involved in methicillin resistance in Staphylococcus aureus. Option: D. It needs to be corrected as option A is correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following options is correct regarding the image given below:", "options": [{"label": "A", "text": "This is done on Mueller Hinton agar", "correct": true}, {"label": "B", "text": "This is the molecular method of testing", "correct": false}, {"label": "C", "text": "This is the immunological method of testing", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. This is done on Mueller Hinton agar", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1690897405931-QTDV033012IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>This is done on Mueller Hinton agar The above image shows the disc diffusion method of antimicrobial susceptibility testing. And it is done on Mueller Hinton agar. So it is the correct answer.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. It is not the molecular method of testing. It is the routine method of antimicrobial susceptibility testing. Option: C. It is also not the immunological method of testing. Option: D. It must be corrected as options B & C are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old male was presented to the hospital emergency by family members with complaints of high-grade fever and disorientation. The attending doctor examined him, and investigations were sent. His TLC Thin-layer chromatography came to be raised, and kidney functions slightly elevated. The doctor suspected sepsis in the patient and decided to start antibiotics on the patient. But before starting antibiotics, the doctor wants to do antibiotic susceptibility testing. Which of the following methods cannot be used for antibiotic susceptibility tests?", "options": [{"label": "A", "text": "Routine method", "correct": false}, {"label": "B", "text": "Molecular method", "correct": false}, {"label": "C", "text": "Immunological method", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Immunological method", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immunological method Immunological methods cannot be used for antibiotic susceptibility testing. So the correct answer is C.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. routine method can be used for antibiotic susceptibility testing, i.e., Kirby Bauer, disk diffusion method, usi ng the antibiotic disc on lawn culture. Option: B. Molecular methods can also be used for antibiotic susceptibility testing by determining resistance genes. Option: D. Option D needs to be corrected as options A and B are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 22 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "All of the following statements are true regarding lepromatous leprosy except:", "options": [{"label": "A", "text": "It shows weak TH 1 response", "correct": false}, {"label": "B", "text": "Bacteria involve Schwann cell, ends and perineural area", "correct": false}, {"label": "C", "text": "Protective antibody generation is commonly seen", "correct": true}, {"label": "D", "text": "It is multibacillary", "correct": false}], "correct_answer": "C. Protective antibody generation is commonly seen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Protective antibody generation is commonly seen Lepromatous leprosy is associated with a weak TH1 response and, in some cases, a relative increase in the TH2 response. Occasionally, in the lepromatous form, antibodies are produced against M. leprae antigens . Paradoxically, these antibodies are usually not protective , but they may form immune complexes with free antigens that can lead to erythema nodosum , vasculitis , and glomerulonephritis . Lepromatous Leprosy is referred to as Multibacillary leprosy . lepromatous leprosy, widespread invasion of the mycobacteria into Schwann cells and into endoneurial and perineural macrophages damages the peripheral nervous system .</p>\n<p><strong>Highyeild:</strong></p><p>Ridley Classification Tuberculoid Leprosy (TT) Borderline Tuberculoid (BT) Borderline Leprosy (BB) Borderline Leprosy (BL) Lepromatous Leprosy (LL)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. It shows a weak TH 1 response. True . Option: B. Bacteria involve Schwann cells, ends, and perineural area. True . Option: D. It is multibacillary. True .</p>\n<p><strong>Extraedge:</strong></p><p>Observation or test Type of leprosy TT BT BB BL LL Number of lesions Single usually Single or few Several Many Very many Size of lesions Variable Variable Variable Variable Small Surface of lesions Very dry, sometimes scaly Dry Slightly shiny Shiny Shiny Sensation in lesions (not face) Absent Moderately or mark- edly diminished Slightly or moderately diminished Slightly diminished Not affected or minimally affected Hair growth in lesions Absent Markedly diminished Moderately dimin- ished Slightly diminished Not affected AFB in lesions Nil Nil or scanty Moderate numbers Many Very many (plus globi) AFB in nasal scraping or in nose blows Nil Nil Nil Usually nil Very many (plus globi) Lepromin test Strongly positive (+++) Weakly positive (+ or ++) Negative Negative Negative</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Skin biopsy from the hypothetic patch is shown below based on the characteristic histological findings that identify the disease:", "options": [{"label": "A", "text": "Lichen planus", "correct": false}, {"label": "B", "text": "Psoriasis", "correct": false}, {"label": "C", "text": "Leprosy", "correct": true}, {"label": "D", "text": "Leukocytoclastic vasculitis", "correct": false}], "correct_answer": "C. Leprosy", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1686826715147-QTDP067002IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Leprosy Neuronal involvement dominates tuberculoid leprosy . Nerves become enclosed within granulomatous inflammatory reactions and, if small (e.g. the peripheral twigs), are destroyed. Nerve degeneration causes skin anesthesias and skin and muscle atrophy that render the person liable to the trauma of the affected parts, leading to the development of chronic skin ulcers . Contractures paralyze, and autoamputation of fingers or toes may ensue. Facial nerve involvement can lead to paralysis of the eyelids, with keratitis and corneal ulcerations . On microscopic examination , all sites of involvement have granulomatous lesions closely resembling those found in tuberculosis. Because of the strong host defense, bacilli are almost never found, hence the name paucibacillary leprosy . The presence of granulomas and the absence of bacteria reflect strong T-cell immunity.</p>\n<p><strong>Highyeild:</strong></p><p>Superficial branch of the radial nerve is used for nerve biopsy in neuritic leprosy . Usually, sensory nerves are preferred for biopsy over mixed or motor nerves. Common nerves used for biopsy: Superficial branch of the radial nerve. Ulnar cutaneous nerve Sural nerve</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Lichen planus. Microscopy shows Hyperkeratosis, Max Joseph space, Saw toothing of Rete ridges, and band-like lymphocytic infiltrate. Option: B. Psoriasis. Microscopy shows Hyperkeratosis, Parakeratosis, Munro’s microabscess, Spongiform pustule of Kogoj, and dilated blood vessels in the dermis. Option: D. Leucocytoclastic vasculitis. Microscopy shows busy dermis with a superficial and mid-perivascular inflammatory pattern. There is a population of predominantly neutrophils in a perivascular and interstitial pattern in addition to those undergoing extravasation from the vessels. Leukocytoclastis (neutrophil degeneration) forming nuclear dust is seen in addition to extravasated erythrocytes. Fibrinoid necrosis of the vessels is also seen.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A distinctive feature of Lyme disease when causing arthritis that is not seen in rheumatoid arthritis is:", "options": [{"label": "A", "text": "Villous hypertrophy", "correct": false}, {"label": "B", "text": "Synovial hyperplasia", "correct": false}, {"label": "C", "text": "Lymphoplasmacytic infiltrate", "correct": false}, {"label": "D", "text": "Arteritis", "correct": true}], "correct_answer": "D. Arteritis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Arteritis Lyme disease is a common arthropod-borne illness caused by spirochetes in the genus Borrelia ( burgdorferi ) that can be localized or disseminated with a tendency to cause persistent chronic arthritis . infected tissue. Lyme disease involves multiple organ systems and is divided into three stages: In early localized disease , spirochetes multiply and spread in the dermis at the site of a tick bite , causing an expanding area of redness, often with a pale center. This lesion, called erythema migrans , may be accompanied by fever and lymphadenopathy. In early disseminated disease , spirochetes spread hematogenously throughout the body and cause secondary skin lesions, lymphadenopathy, migratory joint and muscle pain, cardiac arrhythmias, and meningitis often associated with cranial nerve involvement. The third stage, late disseminated disease , manifests many months after the tick bite. B. burgdorferi usually causes chronic arthritis sometimes with severe damage to large joints . Less often, patients will have polyneuropathy and encephalitis that vary from mild to debilitating.</p>\n<p><strong>Highyeild:</strong></p><p>Lyme’s disease is transmitted by Ixodid tick/ Deer tick and results in Bull’s eye lesion</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Villous hypertrophy. Seen in both Lyme disease and Rheumatoid arthritis . Option: B. Synovial hyperplasia. Seen in both Lyme disease and Rheumatoid arthritis . Option: C. Lympho-plasmacytic infiltrate. Seen in both Lyme disease and Rheumatoid arthritis .</p>\n<p><strong>Extraedge:</strong></p><p>Skin lesions caused by B. burgdorferi are characterized by edema and a lymphocytic-plasma cell infiltrate . In early Lyme arthritis, the synovium resembles early rheumatoid arthritis, with villous hypertrophy, lining-cell hyperplasia, and abundant lymphocytes and plasma cells in the sub synovium . A distinctive feature of Lyme arthritis is arteritis , which produces onion-skin-like lesions resembling those seen in lupus . In late Lyme disease, there may be extensive erosion of the cartilage in large joints. In Lyme meningitis, the CSF is hypercellular due to a marked lymphoplasmacytic infiltrate, and it contains anti-spirochete IgGs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pseudomembranous colitis is caused by", "options": [{"label": "A", "text": "Clostridium perfrigens", "correct": false}, {"label": "B", "text": "C.tetani", "correct": false}, {"label": "C", "text": "C.difficile", "correct": true}, {"label": "D", "text": "Cbotulinum", "correct": false}], "correct_answer": "C. C.difficile", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C.difficile difficile proliferates in the intestines when competition by normal commensal microbiota is reduced by antibiotic treatment . The bacteria release toxins and cause pseudomembranous colitis . difficile produces toxin A , an enterotoxin that stimulates chemokine production and thus attracts leukocytes, and toxin B , a cytotoxin that causes distinctive cytopathic effects in cultured cells. Both toxins are glucosyl transferases and are part of a pathogenicity island that is absent from the chromosomes of nonpathogenic strains of C. difficile. There has been significant success in the treatment of C. difficile with fecal transplantation , emphasizing the role of normal commensal microbiota in defense against pathogens.</p>\n<p><strong>Highyeild:</strong></p><p>Drugs causing Pseudomembranous colitis: MNEMONIC: TALC Tetracyclines Ampicillin and Amoxicillin Lincosamide (Clindamycin) Cephalosporins Drug of choice for Pseudomembranous colitis: Oral vancomycin Drug causing maximum relapse prevention: Fidaxomycin</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Clostridium perfins. Causes cellulitis and myonecrosis of traumatic and surgical wounds (gas gangrene) , uterine myonecrosis is often associated with illegal abortions. Option: B. C. tetani. Causes tetanus , proliferates in puncture wounds and in the umbilical stump of newborn infants, and releases a potent neurotoxin that causes increased muscle tone and generalized spasms of skeletal muscles ( lockjaw ). Option: D. C.botulinum. Causes botulism , grows in inadequately cooked foods, and releases a potent neurotoxin that blocks the synaptic release of acetylcholine and causes flaccid paralysis of respiratory and skeletal muscles .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A stellate abscess is seen in:", "options": [{"label": "A", "text": "Chlamydia", "correct": true}, {"label": "B", "text": "Tuberculosis", "correct": false}, {"label": "C", "text": "Clostridium", "correct": false}, {"label": "D", "text": "Syphilis", "correct": false}], "correct_answer": "A. Chlamydia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlamydia The lesions of lymphogranuloma venereum (LGV) contain a mixed granulomatous and neutrophilic inflammatory response. Variable numbers of chlamydial inclusions are seen in the cytoplasm of epithelial cells or inflammatory cells. Regional lymphadenopathy is common, usually occurring within 30 days of infection. Lymph node involvement is characterized by a granulomatous inflammatory reaction associated with irregularly shaped foci of necrosis containing neutrophils ( stellate abscesses ). With time, the inflammatory reaction is dominated by nonspecific chronic inflammatory infiltrates and extensive fibrosis. The latter, in turn, may cause local lymphatic obstruction, lymphedema, and strictures . In active lesions, the diagnosis of lymphogranuloma venereum may be made by demonstration of the organism in biopsy sections or smears of exudate. In more chronic cases, the diagnosis rests with the demonstration of antibodies to the appropriate chlamydial serotypes in the patient’s serum.</p>\n<p><strong>Highyeild:</strong></p><p>STI kit used for LGV: Black kit .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Tuberculosis. Incorrect . Option: C. Clostridium. Incorrect . Option: D. Syphilis. Incorrect .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following disease shows characteristic Escher formation and lymphadenopathy at the site of chigger bite:", "options": [{"label": "A", "text": "Epidemic typhus", "correct": false}, {"label": "B", "text": "Rocky Mountain fever", "correct": false}, {"label": "C", "text": "Scrub typhus", "correct": true}, {"label": "D", "text": "Ehrlichosis", "correct": false}], "correct_answer": "C. Scrub typhus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Scrub typhus (caused by Orienta tsutsugamushi ) is transmitted by chiggers . It is endemic in areas of Asia, Australia, and some islands in the western Pacific and Indian Oceans. Fever, headache, myalgia, and cough are usual symptoms , sometimes accompanied by a characteristic eschar and associated lymphadenopathy from the chigger bite. The rash is usually transitory or might not appear.</p>\n<p><strong>Highyeild:</strong></p><p>Typhus group of fever: Disease Causative organism Transmitted by Epidemic Typhus R prowazakii Louse Endemic Typhus or Murine Typhus R typhi Flea Rocky Mountain Spotted Fever R rickettsia Hard Tick Scrub Typhus Orentia Tsutsugamushi Trombiculid Mite Q fever Coxiella Burnetta Air > Soft Tick Trench fever/ Quintaniac fever Bartonella Quintana Louse Rickettsial pox R Akari Mite Scabies Sarcoptes Scabies Itch Mite Indian Tick Typhus R conorii Hard Tick</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Epidemic typhus. Caused by Rickettsia prowazekii is transmitted from person to person by body lice . It is associated with wars and poverty, when individuals live in close contact with poor hygiene . Manifestations include a rash that is initially macular, progressing to a petechial, maculopapular rash on the entire body EXCEPT the face, palms, and soles . Option: B. Rocky Mountain fever. Caused by Rickettsia rickettsii is transmitted to humans by dog ticks . It begins as a nonspecific severe illness with fever, myalgias, and gastrointestinal distress, and then progresses to a widespread macular then petechial rash that can involve the palms and soles . Option: D. Ehrlichosis. Caused mainly by Ehrlichia chaffeensis) and anaplasmosis (Anaplasma phagocytophilum) is transmitted by the lone star tick and deer tick, respectively. These bacteria predominantly infect monocytes (E. chaffeensis) or neutrophils (A. phagocytophilum). Ehrlichiosis and anaplasmosis are characterized by abrupt onset of fever, headache, and malaise, and may progress to respiratory insufficiency, renal failure, and shock.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Silver impregnation method of staining is used to demonstrate-", "options": [{"label": "A", "text": "Mycobacteria", "correct": false}, {"label": "B", "text": "Spirochaetes", "correct": true}, {"label": "C", "text": "Both of the above", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "B. Spirochaetes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Spirochaetes Silver impregnation is the traditional method for detecting T. pallidum in formalin-fixed tissues. Involves impregnation of the spirochetes in the tissue with silver ions, with subsequent reduction of these ions to metallic silver using a developer Spirochetes other than T . pallidum will stain with this method. Silver impregnation method: Levaditi stain (for tissue section), Fontana stain (smear)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. The mycobacteria are rod-shaped, aerobic bacteria that do not form spores. Although they do not stain readily, after being stained, they resist decolorization by acid or alcohol and are therefore called acid-fast bacilli. Ziehl-Neelson staining method is used. Levaditi staining for tissues</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which laboratory assays can be used to detect the number and types of immune cells in the peripheral blood?", "options": [{"label": "A", "text": "Immunoblot", "correct": false}, {"label": "B", "text": "Flow cytometry", "correct": true}, {"label": "C", "text": "Enzyme immunoassay", "correct": false}, {"label": "D", "text": "Immunofixation electrophoresis", "correct": false}], "correct_answer": "B. Flow cytometry", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Flow cytometry Flow cytometry (FCM) is a technique used to detect and measure the physical and chemical characteristics of a population of cells or particles. A sample containing cells or particles is suspended in a fluid and injected into the flow cytometer instrument. Flow cytometry has become the technology of choice for monitoring immune cells as it allows the possibility to analyze a large number of parameters simultaneously in a short time and for a reasonable cost, rendering flow cytometry feasible for routine clinical use.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Immunoblot or western blot is used to identify an antigen in a complex mixture of proteins. The complex mix of proteins is subjected to sodium dodecyl sulfate (SDS)- polyacrylamide gel electrophoresis (PAGE). Option: C. Enzyme immunoassay (EIA) testing system is one of the most popular tests used in clinical laboratories to monitor a variety of antibody specificities. This method depends on the conjugation of an enzyme to an antibody. Option: D. A serum immunofixation test measures specific proteins in the blood. It helps to detect multiple myelomas, blood cancer, etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Commonly used stains for identifying fungus includes?", "options": [{"label": "A", "text": "Periodic acid-Schiff (PAS) stain", "correct": false}, {"label": "B", "text": "Lactophenol cotton blue", "correct": false}, {"label": "C", "text": "Gomori methenamine silver", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above Standard histological stains for fungi are Grocott (methenamine) silver (GMS) stain or Periodic acid-Schiff (PAS). G rocott methenamine silver (GMS) stain is commonly used to identify fungi on smears and tissue sections. It imparts a black color to the fungal profiles and a pale green color to the background. It stains all pathogenic and nonpathogenic fungi and melanin. Periodic acid-Schiff (PAS ) stain is a standard stain used to diagnose fungi, typically highlighting fungal cell walls but staining other polysaccharides and mucins. Lactophenol cotton blue is a stain used to examine fungal morphology in mounts prepared from fungal cultures. This stain contains phenol, which will kill the organisms, lactic acid, which preserves fungal structures; and cotton blue, which stains the chitin found in the fungal cell walls. Self-explanatory, as all options are correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Special stain for Cryptococcus?", "options": [{"label": "A", "text": "ZN stain", "correct": false}, {"label": "B", "text": "Gram stain", "correct": false}, {"label": "C", "text": "Malachite Green", "correct": false}, {"label": "D", "text": "Mucicarmine", "correct": true}], "correct_answer": "D. Mucicarmine", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236332447-QTDV034004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mucicarmine Mucicarmine staining helps stain encapsulated fungi like cryptococcus. The principle of mucicarmine staining is based on the presence of aluminum, which forms a chelating complex with carmine. Mucicarmine stain is a staining procedure used for different purposes. In microbiology, the stain aids in the identification of a variety of microorganisms based on whether or not the cell wall stains intensely red. Mucicarmine stain is primarily used to stain mucin, which is produced by epithelial and connective tissue cells. The cryptococcus capsule stains intensely with the mucicarmine stain. This is especially helpful in immunocompetent hosts with a brisk inflammatory response.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Ziehl-Neelson stain is used to stain acid-fast bacilli such as Mycobacterium Option: B. Gram Stain is used for the detection and identification of gram-negative and gram-positive bacteria Option: C. Malachite Green staining is used for bacterial spore staining by Schaeffer and Fulton's method.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The rationale for giving prophylactic antibiotics at the beginning of a surgical procedure can be considered an attempt to prevent the bacteria from entering which of the following growth phases?", "options": [{"label": "A", "text": "Death phase", "correct": false}, {"label": "B", "text": "Lag phase", "correct": false}, {"label": "C", "text": "Log phase", "correct": true}, {"label": "D", "text": "Phase of decline", "correct": false}], "correct_answer": "C. Log phase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Log phase Preoperative antibiotic prophylaxis is defined as administering antibiotics before performing surgery to help decrease the risk of postoperative infections by preventing the bacteria from entering the log phase of growth. It has been determined that in a closed system or batch culture (no food added, no wastes removed), bacteria will grow in a predictable pattern, resulting in a growth curve composed of four distinct phases of growth: the lag phase, the exponential or log phase, the stationary phase, and the death or decline phase. Bacterial growth is the proliferation of bacteria into two daughter cells in a process called binary fission. Providing no event occurs, the resulting daughter cells are genetically identical to the original cell.</p>\n<p><strong>Highyeild:</strong></p><p>The bacterial growth curve represents the live cells in a bacterial population over some time. It has 4 phases. Lag phase – Initial phase is characterized by cellular activity but not growth. A small group of cells are placed in a nutrient-rich medium that allows them to synthesize proteins and other molecules necessary for replication. Log phase – The log phase, or the exponential or logarithmic phase, is one of the phases observed in a bacterial growth curve. The striking feature of this phase is the property of cell doubling through binary fission. The count of bacteria (new) that appear each time is proportionate to the current population. Stationary phase -No of dividing cells is equal to no of dying cells Death phase – as nutrients decrease in the medium and waste products increase. The no of dying cells that growth continues to rise.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Giemsa stained smear cannot detect:", "options": [{"label": "A", "text": "Coxiella burnetii", "correct": true}, {"label": "B", "text": "Malaria", "correct": false}, {"label": "C", "text": "Toxoplasmosis", "correct": false}, {"label": "D", "text": "Trypanosoma", "correct": false}], "correct_answer": "A. Coxiella burnetii", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxiella burnetii Giemsa stain is a classic blood film stain for peripheral blood smears and bone marrow specimens. Giemsa is the prototypical stain used to detect malaria and Trypanosoma-infected blood. The polymerase chain reaction (PCR) is used to detect Coxiella burnetii, an obligate intracellular bacterium and the etiologic agent of Q fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. Giemsa stained smear can detect all these organisms</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A young boy from Himachal Pradesh presented with a small ulcer on his leg; after five days, he developed a fever and inguinal lymphadenopathy. A smear was sent to the laboratory to perform specific bipolar staining. Which one of the following staining methods would help in the identification of the suspected pathogen:", "options": [{"label": "A", "text": "Albert staining", "correct": false}, {"label": "B", "text": "Ziehl-Neelson staining", "correct": false}, {"label": "C", "text": "Mc Fadyean's staining", "correct": false}, {"label": "D", "text": "Wayson staining", "correct": true}], "correct_answer": "D. Wayson staining", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Wayson staining Diagnosis- Bubonic plague. Bubonic plague is the most common form of plague caused by the bite of an infected flea. Plague bacillus, Y. pestis, enters at the edge and travels through the lymphatic system to the nearest lymph node, replicating itself. The lymph node then becomes inflamed, tense, and painful, called a 'bubo.'</p>\n<p><strong>Highyeild:</strong></p><p>The Wayson stain is a primary fuchsin-methylene blue, ethyl alcohol-phenol microscopic staining procedure. It was initially a modified methylene blue stain used for diagnosing bubonic plague. With this stain, Yersinia pestis appears purple with a c haracteristic safety-pin appearance due to the presence of a central vacuole. The Wayson stain is a simple, cheap, modified methylene blue stain originally used for diagnosing murine plague. Wayson Stain aids in the demonstration of polar staining that is most difficult to obtain with the traditional Gram or Loeffler's Methylene Blue stain.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Albert stain is a differential stain used for staining and identifying metachromatic granules. It is chiefly used to demonstrate C. diphtheriae Option: B. Ziehl-Neelsen staining is used in M. Tuberculosis Option: C. McFadyean stain (polychrome methylene blue) is used for capsule staining of bacillus anthracis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The following Image was seen in a nasal biopsy from a patient with a brain abscess. Identify the organism seen and the stain used?", "options": [{"label": "A", "text": "Staphylococcus, Gram-stain", "correct": false}, {"label": "B", "text": "Streptococcus, Gram-stain", "correct": false}, {"label": "C", "text": "Cryptococcus, India ink", "correct": false}, {"label": "D", "text": "Nocardia, Gram-stain", "correct": true}], "correct_answer": "D. Nocardia, Gram-stain", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236334699-QTDV034010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nocardia, Gram-stain The given image shows branching filaments that are seen in Nocardia. Nocardia is Gram-positive , catalase-positive, rod-shaped bacteria. It forms partially a cid-fast beaded branching filaments acting as fungi but being truly bacteria. It contains a total of 85 species. Some species are nonpathogenic, while others are responsible for nocardiosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: -</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are fungal stains except:", "options": [{"label": "A", "text": "Masson's Trichome stain", "correct": true}, {"label": "B", "text": "Grocott's methenamine silver Stain", "correct": false}, {"label": "C", "text": "Lacto phenol cotton blue", "correct": false}, {"label": "D", "text": "Periodic Acid-Schiff", "correct": false}], "correct_answer": "A. Masson's Trichome stain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Masson's Trichome stain Masson's trichrome is a three-color staining protocol used in histology. The recipes evolved from Claude Pierre Masson's original formulation have different specific applications, but all are suited for distinguishing cells from surrounding connective tissue. Standard applications: Masson's trichrome staining is widely used to study muscular pathologies (muscular dystrophy), cardiac pathologies (infarct), hepatic pathologies (cirrhosis) or kidney pathologies (glomerular fibrosis). It can also detect and analyze tumors on hepatic and kidney biopsies.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C and D - These are all fungal stains Fungal Stains Stain Comments Mycology Lab Calcofluor white fluorochrome that binds glucans and chitin in fungal cell wall Lactophenol Cotton Blue cotton blue (aka analine blue) dye stains chitin and allows visualization of fungal elements following scraping or tape preparation from culture Pathology Hematoxylin and esoin (H&E) used to visualize host cell response to fungi but doesn't stain most fungi; exceptions are Aspergillus spp. and the Mucorales. Grocott methenamine silver (GMS) stains fungal cell wall black Periodic acid-Schiff (PAS) stains polysaccharide component of fungal cell wall magenta Selected specific stains India ink negative\" stain that outlines the polysaccharide capsule of Cryptococcus sp; not as sensitive as Ag detection for cryptococcal meningitis; some strains are reportedly acapsular. Mucicarmine can be used to stain mucopolysaccharide capsule of Cryptococcus sp.; also stains Blastomyces and Rhinosporidium Fontana-Masson silver stain used to detect melanin pigment in cell walls of Cyptococcus</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Staining is a critical diagnostic method for detecting the presence of organisms and the nature of cellular contents in the specimen. The following are examples of basic dyes. Crystal violet Methylene Blue Malachite Green Eosin Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1 AND 2 ARE CORRECT", "correct": true}, {"label": "B", "text": "2 AND 4 ARE CORRECT", "correct": false}, {"label": "C", "text": "1 AND 4 ARE CORRECT", "correct": false}, {"label": "D", "text": "3 AND 4 ARE CORRECT", "correct": false}], "correct_answer": "A. 1 AND 2 ARE CORRECT", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1 AND 2 ARE CORRECT Options A, B, and C. The commonly used stains are salts. Basic stains consist of a colored cation with a colorless anion (e.g., methylene blue + chloride −, Crystal violet, etc.); acidic stains are the reverse (e.g., sodium + inosinate −, eosin, Nigrosin, etc.). Bacterial cells are rich in nucleic acid, bearing negative charges as phosphate groups. These combine with the positively charged basic dyes. Acidic dyes do not stain bacterial cells and hence can be used to stain background material a contrasting color. Option D. Flagella are too delicate (12–30 nm in diameter) to be visible in the light microscope. However, their presence and arrangement can be demonstrated by treating the cells with an unstable colloidal suspension of tannic acid salts, causing a heavy residue on the cell walls and flagella.</p>\n<p><strong>Extraedge:</strong></p><p>ACIDIC STAIN BASIC STAIN NEUTRAL STAIN ● Carries negative charge ● Examples:- Nigrosin, eosin, carbol fuschin, india ink, malachite green etc. ● Carries positive charge ● Examples:- Crystal violet, methylene blue, safranin etc. ● Carries both positive and negative charge ● Examples:- Geimsa's stain, leishman stain, wright's stain etc.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Gram staining is the most crucial method for bacterial identification in the clinical specimen. The correct sequence of the Gram-staining procedure Application of a basic dye, crystal violet. A solution of iodine is then applied Smear is then treated with acetone/alcohol A counterstain, safranin, is applied Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1 4 3 2", "correct": false}, {"label": "B", "text": "3 2 1 4", "correct": false}, {"label": "C", "text": "1 2 3 4", "correct": true}, {"label": "D", "text": "2 1 3 4", "correct": false}], "correct_answer": "C. 1 2 3 4", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1 2 3 4 Option A. The Gram-staining procedure begins with applying a basic dye, crystal violet. A solution of iodine is then applied; all bacteria will be stained blue at this point in the procedure. The cells are then treated with acetone or alcohol. Gram-positive cells retain the crystal violet iodine complex, remaining blue; gram-negative cells are completely decolorized by alcohol. As a last step, a counter-stain (e.g., the red dye safranin) is applied so that the decolorized gram-negative cells will take on a contrasting color; the gram-positive cells now appear purple. The basis of the differential Gram reaction is the structure of the cell wall.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C & D. Incorrect, as option A has the correct sequence.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Special staining techniques are required to demonstrate various cellular components, i.e., capsule, flagella, cell wall, granules spore, etc. Nigrosin stain is used in:", "options": [{"label": "A", "text": "Gram stain", "correct": false}, {"label": "B", "text": "Acid-fast stain", "correct": false}, {"label": "C", "text": "Feulgen stain", "correct": false}, {"label": "D", "text": "Negative staining", "correct": true}], "correct_answer": "D. Negative staining", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Negative staining Negative Staining -This procedure involves s taining the background with an acidic dye, leaving the cells contrastingly colorless. The black dye nigrosin is commonly used.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Gram stain: Gram-staining is the most widely used stain in a bacteriological lab, and the basis of the differential Gram reaction is the structure of the cell wall. Option B. The Acid-Fast Stain: Acid-fast bacteria retain carbolfuchsin (basic fuchsin dissolved in a phenol–alcohol–water mixture) even when decolorized with hydrochloric acid in alcohol. Option C. Nucleoids are stainable with the Feulgen stain, which is specific for DNA. Feulgen stain is used to identify DNA in cells in specimens.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identification of infectious agents is essential for deciding upon effective antimicrobial therapy. In the Gram-staining procedure, the counterstain is:", "options": [{"label": "A", "text": "Crystal violet", "correct": false}, {"label": "B", "text": "Iodine", "correct": false}, {"label": "C", "text": "Alcohol", "correct": false}, {"label": "D", "text": "Safranin", "correct": true}], "correct_answer": "D. Safranin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Safranin The Gram-staining procedure begins with applying a basic dye, crystal violet. A solution of iodine is then applied; all bacteria will be stained blue at this point in the procedure. The cells are then treated with alcohol. Gram-positive cells retain the crystal violet iodine complex, remaining blue; gram-negative cells are completely decolorized by alcohol. As a last step, a counterstain (e.g., the red dye safranin) is applied so that the decolorized gram-negative cells will take on a contrasting color; the gram-positive cells now appear purple. The basis of the differential Gram reaction is the structure of the cell wall.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B & C. Incorrect as steps explained above.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Microscope is the essential equipment of any diagnostic Microbiology lab. True about Dark-Field Microscopes is The dark-field microscope is a light microscope in which the lighting system has been modified to reach the specimen from the sides only This is accomplished by using a special condenser that blocks direct light rays and deflects light off a mirror on the side of the condenser at an oblique angle. This creates a \"bright field\" that contrasts against the dark edge of the specimens and results when the oblique rays are reflected from the edge of the model upward into the objective of the microscope Resolution by dark-field microscopy is low Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1 and 2 are false", "correct": false}, {"label": "B", "text": "2 and 4 are false", "correct": false}, {"label": "C", "text": "only 4 are false", "correct": false}, {"label": "D", "text": "3 and 4 are false", "correct": true}], "correct_answer": "D. 3 and 4 are false", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>3 and 4 are false Dark-Field Microscope The dark-field microscope is a light microscope in which the lighting system has been modified to reach only the specimen from the sides. This is accomplished by using a special condenser that blocks direc t light r ays and deflects light off a mirror on the side o f the condenser at an oblique angle. This creates a “dark field” that contrasts against the highlighted edge of the specimens and results when the oblique rays are reflected from the model's edge upward into the microscope's objective. Re solution by dark-field microscopy is relatively high. Th us, this technique has been beneficial for observing organisms such as Treponema pallidum, a spirochete smaller than 0.2 μm in diameter and, therefore, cannot be marked with a bright-field or phase contrast microscope.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B & C. Explained above.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Staining is essential for the identification of infectious agents and also for effective antimicrobial therapy and follow-up. Carbolfuchsin is used in:", "options": [{"label": "A", "text": "Gram stain", "correct": false}, {"label": "B", "text": "Acid-fast stain", "correct": true}, {"label": "C", "text": "Feulgen stain,", "correct": false}, {"label": "D", "text": "Negative staining", "correct": false}], "correct_answer": "B. Acid-fast stain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acid-fast stain Acid-fast bacteria retain carbolfuchsin (basic fuchsin dissolved in a phenol–alcohol–water mixture) even when decolorized with hydrochloric acid in alcohol.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Gram stain: Gram-staining is the most widely used stain in a bacteriological lab, and the basis of the differential Gram reaction is the structure of the cell wall. Option C. Nucleoids are stainable with the Feulgen stain, which is specific for DNA. Option D. Negative Staining -This procedure involves staining the background with an acidic dye, leaving the cells contrastingly colorless. The black dye nigrosin is commonly used.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of these are used to stain spores? Crystal violet Safranin Malachite green Nigrosin Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1 AND 2 ARE CORRECT", "correct": false}, {"label": "B", "text": "2 AND 3 ARE CORRECT", "correct": true}, {"label": "C", "text": "1 AND 4 ARE CORRECT", "correct": false}, {"label": "D", "text": "Only 4 are correct", "correct": false}], "correct_answer": "B. 2 AND 3 ARE CORRECT", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>2 AND 3 ARE CORRECT Spores are commonly stained with malachite green and safranin</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Crystal violet is used in Gram stain. Option C & D. Crystal violet is used in Gram stain. Negative staining involves staining the background with an acidic dye, leaving the cells contrastingly colorless. The black paint Nigrosin is commonly used.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In the Gram-staining procedure, gram-positive cells appear as?", "options": [{"label": "A", "text": "Red", "correct": false}, {"label": "B", "text": "Purple", "correct": true}, {"label": "C", "text": "Blue", "correct": false}, {"label": "D", "text": "Pink", "correct": false}], "correct_answer": "B. Purple", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Purple The Gram-staining procedure begins with applying a basic dye, crystal violet. A solution of iodine is then applied; all bacteria will be stained blue at this point in the procedure. The cells are then treated with alcohol. Gram-positive cells retain the crystal violet iodine complex, remaining blue; gram-negative cells are completely decolorized by alcohol. As a last step, a counterstain (e.g., the red dye safranin) is applied so that the decolorized gram-negative cells will take on a contrasting color; the gram-positive cells now appear purple. The basis of the differential Gram reaction is the structure of the cell wall.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C & D. Blue color is not seen in gram staining as it is used to differentiate between gram-positive and gram-negative bacteria. Purple color is seen in Gram-positive bacterium, and red or pink is seen in gram-negative bacterium</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Mycobacteria have a tough waxy material (mycolic acid) in their cell wall. Mycobacteria are stained by:", "options": [{"label": "A", "text": "Gram stain", "correct": false}, {"label": "B", "text": "Acid-fast stain", "correct": true}, {"label": "C", "text": "Feulgen stain,", "correct": false}, {"label": "D", "text": "Negative staining", "correct": false}], "correct_answer": "B. Acid-fast stain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acid-fast stain In Acid-Fast Stain, Acid-fast bacteria retain carbolfuchsin (basic fuchsin dissolved in a phenol–alcohol–water mixture) even when decolorized with hydrochloric acid in alcohol.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Gram-staining is the most widely used stain in a bacteriological lab, and the basis of the differential Gram reaction is the structure of the cell wall. Option: C. Nucleoids are stainable with the Feulgen stain, which is specific for DNA. Option: D. Negative Staining -This procedure involves staining the background with an acidic dye, leaving the cells contrastingly colorless. The black paint Nigrosin is commonly used.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The Mordant in Gram-staining procedure is?", "options": [{"label": "A", "text": "Crystal violet", "correct": false}, {"label": "B", "text": "Iodine", "correct": true}, {"label": "C", "text": "Alcohol", "correct": false}, {"label": "D", "text": "Safranin", "correct": false}], "correct_answer": "B. Iodine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Iodine The Gram-staining procedure begins with applying a basic dye, crystal violet. A solution of iodine (mordant) is then applied; all bacteria will be stained blue at this point in the procedure. The cells are then treated with alcohol. Gram-positive cells retain the crystal violet iodine complex, remaining blue; gram-negative cells are completely decolorized by alcohol. As a last step, a counter-stain (e.g., the red dye safranin) is applied so that the decolorized gram-negative cells will take on a contrasting color; the gram-positive cells now appear purple. The basis of the differential Gram reaction is the structure of the cell wall.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The commonly used stains are salts divided into Basic and Acidic stains. Basic dyes are?", "options": [{"label": "A", "text": "Positively charged", "correct": true}, {"label": "B", "text": "Negatively charged", "correct": false}, {"label": "C", "text": "Neutral", "correct": false}, {"label": "D", "text": "Zero net charge", "correct": false}], "correct_answer": "A. Positively charged", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Positively charged Options A & B. The commonly used stains are salts. Basic stains consist of a colored cation with a colorless anion (e.g., methylene blue + chloride −, Crystal violet); acidic stains are the reverse (e.g., sodium + inosinate − ). Bacterial cells are rich in nucleic acid, bearing negative charges as phosphate groups. These combine with the positively charged basic dyes. Acidic dyes (negatively charged) do not stain bacterial cells and hence can be used to stain background material with a contrasting color.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option C & D. As the dyes are cations or anions, these options are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Nucleoids are stainable with:", "options": [{"label": "A", "text": "Gram stain", "correct": false}, {"label": "B", "text": "Acid-fast stain", "correct": false}, {"label": "C", "text": "Feulgen stain,", "correct": true}, {"label": "D", "text": "Negative staining", "correct": false}], "correct_answer": "C. Feulgen stain,", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Feulgen stain, Nucleoids are stainable with the Feulgen stain, which is specific for DNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Gram stain: Gram-staining is the most widely used stain in a bacteriological lab, and the basis of the differential Gram reaction is the structure of the cell wall. Option B. The Acid-Fast Stain Acid-fast bacteria are those that retain carbolfuchsin (basic fuchsin dissolved in a phenol–alcohol-water mixture) even when decolorized with hydrochloric acid in alcohol Option D. Negative Staining -This procedure involves staining the background with an acidic dye, leaving the cells contrastingly colorless. The black paint Nigrosin is commonly used.</p>\n<p><strong>Extraedge:</strong></p><p>Feulgen reaction mechanism& definition An aldehyde specific reaction based on the formation of a purple-coloured compound when aldehydes react with fuchsin- sulfuric acid; deoxyribonucleic acid gives this reaction after removal of its purine bases by acid hydrolysis: used as a nuclear stain</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In the Gram-staining procedure, gram-negative cells appear:", "options": [{"label": "A", "text": "Red", "correct": false}, {"label": "B", "text": "Purple", "correct": false}, {"label": "C", "text": "Blue", "correct": false}, {"label": "D", "text": "Pink", "correct": true}], "correct_answer": "D. Pink", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pink The Gram-staining procedure begins with applying a basic dye, crystal violet. A Solution of iodine is then applied; all bacteria will be stained blue at this point in the procedure. The cells are then treated with alcohol. Gram-positive cells retain the crystal violet iodine complex, remaining blue; gram-negative cells are completely decolorized by alcohol. As a last step, a counterstain (e.g., the red dye safranin) is applied so that the decolorized gram-negative cells will take on a contrasting color; the gram-positive cells now appear purple. The basis of the differential Gram reaction is the structure of the cell wall.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and C. All other options must be corrected, as option D is the correct answer. Option B. Gram-positive organisms appear in purple.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The resolving power of the light microscope under ideal conditions is about _______ the wavelength of the light being used:", "options": [{"label": "A", "text": "0.5", "correct": true}, {"label": "B", "text": "1", "correct": false}, {"label": "C", "text": "1.5", "correct": false}, {"label": "D", "text": "2", "correct": false}], "correct_answer": "A. 0.5", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>0.5 The resolving power of the light microscope under ideal conditions is about half the wavelength of the light being used. Resolving power is the distance that must separate two point light sources to be seen as two different images. With yellow light of a wavelength of 0.4 μm, the minor separable diameters are thus about 0.2 μm (i.e., one-third the width of a typical prokaryotic cell). The useful magnification of a microscope is the magnification that makes visible the smallest resolvable particles. The resolving power of a microscope depends upon the wavelength of illumination and numerical aperture of the objective lens. Resolving Power of microscope = 2 n sin θ λ, where the wavelength is the refractive index of the medium separating object, and the aperture is the angular separation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, D. Other options are incorrect as option A is the correct answer.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 33 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 12-year-old boy who recently emigrated from Pakistan presents with fever, muscle pain, and weakness of the trunk, abdomen, and legs. The patient’s mother says that he has not been vaccinated. Physical examination reveals fasciculation and flaccid paralysis of the lower limbs. A CSF analysis reveals lymphocytosis with normal glucose and protein levels. A throat swab reveals an RNA virus. Which of the following would most likely be destroyed by the virus in this patient?", "options": [{"label": "A", "text": "Basal ganglia", "correct": false}, {"label": "B", "text": "Posterior horn cells of the spinal cord", "correct": false}, {"label": "C", "text": "Myelin sheath of neurons", "correct": false}, {"label": "D", "text": "Anterior horn of the spinal cord", "correct": true}], "correct_answer": "D. Anterior horn of the spinal cord", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anterior horn of the spinal cord The patient most likely has acute poliomyelitis , caused by the poliovirus , a single-stranded RNA virus belonging to the Enterovirus family . Poliovirus destroys the motor neurons of the anterior horn of the spinal cord, resulting in flaccid asymmetric paralysis and muscle atrophy.</p>\n<p><strong>Highyeild:</strong></p><p>The disease has 2 basic patterns: Abortive poliomyelitis: a minor self-limited illness that does not involve the central nervous system (CNS). Acute flaccid paralysis: a major paralytic illness that involves the CNS. About 1–5 in 1,000 cases progress to paralytic disease in which the skeletal muscles become poorly controlled, weak, floppy, and atrophied . Poliovirus is highly contagious. It spreads via the faecal-oral route and respiratory droplets. Several factors that increase the risk of polio infection and affect the severity of the disease include comorbid immune deficiency, malnutrition, and engaging in physical activity immediately following the onset of paralysis. The poliovirus vaccine is very successful and almost all countries, except Pakistan and Afghanistan, have been largely polio-free due to proper immunization.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The basal ganglia play an important part in controlling voluntary movements. Parkinson’s disease and Huntington’s disease are degenerative conditions that affect the basal ganglia . Neuro-Behçet’s disease, several types of Flavivirus, and CNS toxoplasmosis are some of the infections affecting the basal ganglia. Option B. Poliovirus destroys the anterior (not the posterior) horn of the spinal cord. Option C. Demyelination occurs in multiple sclerosis . It also occurs in certain cases where a viral invasion of the CNS occurs, such as with progressive multifocal leukoencephalopathy, subacute sclerosing panencephalitis, and tropical spastic paraparesis/HTLV-1–associated myelopathy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 16-year-old male presented with seizures and ataxia suggestive of demyelination disease. MRI brain shows Panencephalitis involving both grey and white mater. Patients have high levels of Measles antibodies in the CSF. What is the most likely diagnosis?", "options": [{"label": "A", "text": "Subacute sclerosing panencephalitis", "correct": true}, {"label": "B", "text": "Progressive multifocal leuco-encephalopathy", "correct": false}, {"label": "C", "text": "Rubella encephalitis", "correct": false}, {"label": "D", "text": "Creutzfeldt-Jakob diseases", "correct": false}], "correct_answer": "A. Subacute sclerosing panencephalitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Subacute sclerosing panencephalitis Subacute sclerosing panencephalitis (SSPE) is a slowly progressive de-myelinations diastase caused by the defective measles virus. SSPE usually occurs 7-13 years after Measles infection and manifests as seizures, myoclonus, ataxia and visual disturbances.</p>\n<p><strong>Highyeild:</strong></p><p>CSF analysis shows high titres of antibodies to the measles virus. MRI brain shows the involvement of White and Grey matter both . SSPE is a late complication of Measles infection, not Measles immunization.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Progressive multifocal leuco-encephalopathy (PML) is caused by a Human polyoma virus called JC virus. Most patients are immunodeficiencies such as AIDS, malignancy or transplantation. MRI brain detects asymmetric multifocal lesions in the white matter of the brain. Option C. Rubella encephalitis is an SSPE-like condition but extremely rare. Option D. Creutzfeldt-Jakob disease (CJD) is a prion disease , that presents as dementia and myoclonus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 16-year-old male presented with seizures and ataxia suggestive of de-myelinations disease. MRI brain shows Panencephalitis involving both grey and white mater. Patients have high levels of Measles antibodies in the CSF suggestive of post Measles infection complications. Which of the following statements is incorrect regarding the likely diagnosis?", "options": [{"label": "A", "text": "Occurs in 1 in 1-5 lakhs measles cases", "correct": false}, {"label": "B", "text": "Usually develops after 7-13 years after primary measles infection.", "correct": false}, {"label": "C", "text": "Isolated measles virus strains in such cases are defective.", "correct": false}, {"label": "D", "text": "Predominant antibody is against the M protein of the Measles virus.", "correct": true}], "correct_answer": "D. Predominant antibody is against the M protein of the Measles virus.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Predominant antibody is against the M protein of the Measles virus. The above case is suggestive of Subacute sclerosing panencephalitis. SSPE is a late complication of Measles infection, not Measles immunization.</p>\n<p><strong>Highyeild:</strong></p><p>Subacute sclerosing panencephalitis (SSPE) is a slowly progressive de-myelinations diastase caused by defective measles virus which is an RNA virus . Patients with subacute sclerosing pan-encephalitis have high titres of anti-measles antibody except that antibody to the M protein is frequently lacking.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. SSPE is rare, with 1 in 1–5 lakh measles cases. Option B. SSPE usually occurs 7-13 years after Measles infection and manifests as seizures, myoclonus, ataxia and visual disturbances. CSF analysis shows high titres of antibodies to the measles virus. Option C. Measles virus strains isolated from SSPE are defective.</p>\n<p><strong>Extraedge:</strong></p><p>Carbamazepine (CBZ) plays an important role in the symptomatic treatment of SSPE. Although CBZ is known to exacerbate generalized myoclonus in epilepsy, it is paradoxically effective in the treatment of myoclonus in some patients with SSPE.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42 year HIV positive old male was admitted to Neurology ICU with complaints of ataxia, weakness, seizures and visual impairment. MRI scan detects asymmetric lesions in the white matter of the brain suggestive of progressive multifocal leuco-encephalopathy. Which of the following is the causative agent?", "options": [{"label": "A", "text": "Measles virus", "correct": false}, {"label": "B", "text": "JC virus", "correct": true}, {"label": "C", "text": "BK virus", "correct": false}, {"label": "D", "text": "Visna virus", "correct": false}], "correct_answer": "B. JC virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>JC virus Progressive multifocal leuco-encephalopthy (PML) is caused by a Human Polyoma virus called JC virus named after the patient John Cunningham, in whom it was described first. Most patients are immunodeficiency with depressed cell-mediated immunity such as AIDS, malignancy or transplantation . PML occur in up to 5% of AIDS patients. MRI brain detects asymmetric multifocal lesions in the white matter of the brain. Natalizumab is a monoclonal antibody which can be associated with the reactivation of JC virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Subacute sclerosing panencephalitis (SSPE) is a slowly progressive de-myelinations diastase caused by the defective measles virus. SSPE usually occurs 7-13 years after Measles infection and manifests as seizures, myoclonus, ataxia and visual disturbances. CSF analysis shows high titres of antibodies to the measles virus. MRI brain shows the involvement of White and Grey matter both. Option C. BK virus causes hemorrhagic cystitis in bone marrow transplant recipients. It is the cause of polyomavirus-associated nephropathy in renal transplant recipients. Option D. Visna virus causes demyelination of CNS in sheep.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42 year HIV positive old male was admitted to Neurology ICU with complaints of ataxia, weakness, seizures and visual impairment. MRI scan detects asymmetric lesions in the white matter of the brain suggestive of progressive multifocal leuco-encephalopathy. Which of the following statement is false about PML?", "options": [{"label": "A", "text": "Is a slow virus disease", "correct": false}, {"label": "B", "text": "Caused by RNA virus", "correct": true}, {"label": "C", "text": "Occurs when cell-mediated immunity is compromised", "correct": false}, {"label": "D", "text": "Affects about 5% of AIDS patients.", "correct": false}], "correct_answer": "B. Caused by RNA virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Caused by RNA virus Progressive multifocal leuco-encephalopathy (PML) is caused by a Human Polyomavirus called JC virus named after the patient John Cunningham, in whom it was described first. It is a DNA virus. Natalizumab is a monoclonal antibody which can be associated with the reactivation of JC virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It is a slow virus disease with a long incubation period. Option C. Most patients are immunodeficiency with depressed cell-mediated immunity such as AIDS, malignancy or transplantation, which causes reactivation and replication of the JC virus. Option D. PML occurs in up to 5% of AIDS patients.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Scrapie is a prion disease which occurs naturally in sheep. Which of the following is not prion disease in humans?", "options": [{"label": "A", "text": "Kuru", "correct": false}, {"label": "B", "text": "Creutzfeldt-Jakob disease", "correct": false}, {"label": "C", "text": "Gerstmann-Straussler-Scheinker disease", "correct": false}, {"label": "D", "text": "Bovine spongiform encephalopathy", "correct": true}], "correct_answer": "D. Bovine spongiform encephalopathy", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bovine spongiform encephalopathy Bovine spongiform encephalopathy (BSE), also called mad cow disease , is a disease of cattle that can be transmitted via feeding the cattle with meat and bone meal contaminated with scrapi It is a prion disease caused by infectious proteinaceous particles.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Kuru was seen only in the Eastern Highlands of New Guinea and was spread by customs surrounding ritual cannibalism of dead relatives infected with the disease. Since this practice has ceased, the disease has disappeared now. Option B. Creutzfeldt-Jakob disease (CJD) is the most common form of prion disease in humans Option C. Gerstmann-Straussler-Scheinker disease , a variant of familial CJD is also a disease in humans caused by Prions . Another human prions disease is Fatal familial insomnia.</p>\n<p><strong>Extraedge:</strong></p><p>Creutzfeldt-Jakob (KROITS-felt YAH-kobe) disease, also known as CJD, is a rare brain disorder that leads to dementia. It belongs to a group of human and animal diseases known as prion disorders. Symptoms of Creutzfeldt-Jakob disease can be similar to those of Alzheimer's disease.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 92-year-old man presented with dementia and myoclonus in an emergency for the last 1 year. He died within an hour of admission and an autopsy was performed. Brain biopsy shows spongiform degeneration with a lack of inflammatory response suggestive of prions infection. Which of the following statements are incorrect regarding Prions infection?", "options": [{"label": "A", "text": "Prions are infectious protein particles without nucleic acid.", "correct": false}, {"label": "B", "text": "PrPc is the prion protein form that causes disease in human", "correct": true}, {"label": "C", "text": "Long incubation period", "correct": false}, {"label": "D", "text": "Fast disease progression", "correct": false}], "correct_answer": "B. PrPc is the prion protein form that causes disease in human", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>PrPc is the prion protein form that causes disease in human PrP sc is the Prion protein form that causes prion disease in man/ animals. Following infection, the infectious protein particles are carried to the brain and induce misfolding of normal cellular prion proteins ( PrPc ) to form its disease-causing form ( PrPsc ). This prion disease can be associated with myoclonus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Prions are infectious protein particles that lack any nucleic acid . Prions are extremely resistant to most common sterilisation procedures. Option C. Incubation period of Prions disease varies from months to years Option D. Once the disease sets in progression is very fast and generally causes d eath within a year of disease.</p>\n<p><strong>Extraedge:</strong></p><p>Prion diseases are transmissible, untreatable, and fatal brain diseases of mammals. Their cause is highly unusual: The host's normal prion protein can, for unknown reasons, malfunction and assemble into structured aggregates called prions that cause infectious brain disease.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 17 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Caucasian woman, age 37, graphic designer, married, with two children, with no previous surgery, had a traffic trauma, which is why she was referred for an upper abdomen ultrasound. The ultrasound registered a tumor mass in the right liver lobe over 10 cm in diameter. After that, a computed tomography scan and magnetic resonance (MR) imaging gave the diagnosis of a primary liver tumor, which was compressing the right and middle hepatic veins. Other laboratory parameters showed slightly elevated hepatic enzymes with normal bilirubin levels. There were no hepatitis antibodies or elevated alpha-fetoprotein (AFP). The patient was in good physical condition, a bi-cycle driver, and hiker. The only suggestion she gave in a medical interview before the operation was that she consumed over two liters of milk and other dairy products (yogurt and white cheese) per day over 20 years. Toxin produced which of the following fungal organisms can be suspected as a cause for the patient's condition?", "options": [{"label": "A", "text": "Aspergillus Niger", "correct": false}, {"label": "B", "text": "Aspergillus flavus", "correct": true}, {"label": "C", "text": "Aspergillus fumigatus", "correct": false}, {"label": "D", "text": "Rhizopus", "correct": false}], "correct_answer": "B. Aspergillus flavus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus flavus Aspergillus flavus species produces aflatoxins which are associated with hepatocellular carcinoma.</p>\n<p><strong>Highyeild:</strong></p><p>Aspergillus flavus produces yellow color colonies on SDA Sabouraud Dextrose Agar agar characterized by septate and acute angle Highway with an area covering two third of the vesicle</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Aspergillus Niger causes otitis media and produces black color colonies on SDA Sabouraud Dextrose Agar on lactophenol cotton blue mount it produces septate hyphae with acute angle and dichotomous branching. Option C. Aspergillus fumigatus produces green color colonies on the culture media and is associated with paranasal sinus infections. Option D. Rhizopus Mucor mycosis and absidIa species are characterized by the presence of obtuse angle hyphae and aseptate hyphae.</p>\n<p><strong>Extraedge:</strong></p><p>Aspergillus niger is a mold classified within the Nigri section of the Aspergillus genus. The Aspergillus genus consists of common molds found throughout the environment within soil and water, on vegetation, in fecal matter, on decomposing matter, and suspended in the air.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old boy presented in the emergency complaining of severe abdominal pain, vomiting, and diarrhea. His renal function tests were deranged suggestive of nephropathies. He had a history of consumption of 1-week-old bread at home suggestive of Mycotoxicosis. Which of the following are the most likely causative fungi?", "options": [{"label": "A", "text": "Aspergillus niger", "correct": true}, {"label": "B", "text": "Fusarium moniliforme", "correct": false}, {"label": "C", "text": "Claviceps purpurea", "correct": false}, {"label": "D", "text": "Amanita phalloides", "correct": false}], "correct_answer": "A. Aspergillus niger", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus niger Aspergillosis niger liberates Ochratoxin and the usual source are cereals and bread. It causes Nephropathy. Ochratoxin is also liberated by Aspergillus ochraceus and Penicillium verrucusom.</p>\n<p><strong>Highyeild:</strong></p><p>The fungus Aspergillus niger is a type of mold, which can sometimes be attributed to the cause of some cases of pneumonia . It is also the causative agent of 'black mold</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Fusarium moniliforme produces Fumonisin toxins on Maize and can cause oesophageal cancer. Option C. Claviceps purpurea causes Mycetism called Ergotism from Rye flour Option D. Amanita phalloides is an edible mushroom that can cause Mycetism due to cyclopeptide.</p>\n<p><strong>Extraedge:</strong></p><p>niger causes a disease known as \"black mold\" on certain fruits and vegetables such as grapes, apricots, onions, and peanuts, and is a common contaminant of food. It is ubiquitous in soil and is commonly found in indoor environments, where its black colonies can be confused with those of Stachybotrys (species of which have also been called \"black mold\").</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old female presented in the emergency complaining of severe abdominal pain, vomiting, and diarrhea. Her liver function tests were deranged suggestive of Hepatitis. She had a history of consumption of old nuts at home suggestive of Mycotoxicosis. Which of the following are the most likely causative fungi?", "options": [{"label": "A", "text": "Aspergillosis niger", "correct": false}, {"label": "B", "text": "Fusarium moniliforme", "correct": false}, {"label": "C", "text": "Aspergillus flavus", "correct": true}, {"label": "D", "text": "Amanita phalloides", "correct": false}], "correct_answer": "C. Aspergillus flavus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Aspergillus flavus Aspergillus flavus produces aflatoxin. The usual source of infections is contaminated Nuts and Maize consumption. Clinically it may present as Hepatitis, Hepatoma, Cirrhosis, HCC, and Reye’s syndrome. Aflatoxin is also liberated by Aspergillus parasiticus, A. No minus, Penicillium puberulum.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Aspergillosis niger liberate Ochratoxin and the usual source are cereals and bread. It causes Nephropathies. Option B. Fusarium moniliforme produces Fumonisin toxins on Maize and can cause oesophageal cancer. Option D. Amanita phalloides is an edible mushroom that can cause Mycetism due to cyclopeptide.</p>\n<p><strong>Extraedge:</strong></p><p>Clinically, Mucor mycosis is characterized by necrosis with a dark central part or by necrotizing cellulitis, while in the case of Aspergillus infection papules are present, nodules, and/or necrosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old female presented in the emergency complaining of severe abdominal pain, vomiting, and diarrhea. Her liver function tests were deranged suggestive of Hepatitis. She had a history of consumption of old nuts at home suggestive of Mycotoxicosis. Which of the following fungal species and toxin-produced combinations is incorrect?", "options": [{"label": "A", "text": "Aspergillus flavus- Aflatoxin", "correct": false}, {"label": "B", "text": "Aspergillus niger- Ochratoxin", "correct": false}, {"label": "C", "text": "Fusarium moniliforme- Fumonisins", "correct": false}, {"label": "D", "text": "Penicillium verrucosum- Zearalenones", "correct": true}], "correct_answer": "D. Penicillium verrucosum- Zearalenones", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Penicillium verrucosum- Zearalenones Penicillium tuberculum releases aflatoxin Zearalenones is liberated by Fusarium graminearum.</p>\n<p><strong>Highyeild:</strong></p><p>Table: Fungal species and toxins produced Mycotoxin Main Producing Fungi Toxic Effects Source Aflatoxins Aspergillus flavus, A. parasiticus, A. aflatoxiformans Hepatotoxicity, carcinogenicity, immunosuppression [3] Ochratoxins Aspegillus ochraceus, Penicillium verrucosum, A. carbonarius, A. niger Nephrotoxicity, hepatotoxicity, carcinogenicity, teratogenicity, and immunosuppression [4] Deoxynivalenol Fusarium. graminearum (Giberella zeae), F. culmorum, F. sporotrichioides, F. tricinctum, F. Roseum, F. acuminatum Gastrointestinal toxicity, immunodepression [5] Zearalenone Fusarium. graminearum (Giberella zeae), F. culmorum, F. sporotrichioides, F. verticillioides (F. moniliforme), F. semitectum, F. equiseti and F. oxysporum Reproduction toxicity [6] Fumonisins Fusarium verticillioides, F. proliferatum Carcinogenicity, hepatotoxicity [7]</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Aspergillus flavus- Aflatoxin Option B. Aspergillus niger- Ochratoxin Option C. Fusarium moniliforme- Fumon</p>\n<p><strong>Extraedge:</strong></p><p>Aspergillus and Rhizopus are saprophytic fungi which cause fatal infections in immunocompromised patients. Aspergillus can be treated with systemic antifungals, but Rhizopus infections require aggressive surgical intervention.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old boy presented in the emergency with complaints of severe abdominal pain, vomiting and diarrhea, and a disulfiram-like reaction. He had a history of consumption of Butter toast in his last meal. Clinician suspects Mycetism in the patient is most likely due to:", "options": [{"label": "A", "text": "Claviceps purpurea", "correct": false}, {"label": "B", "text": "Coprine atramentarius", "correct": true}, {"label": "C", "text": "Inocybe fastigata", "correct": false}, {"label": "D", "text": "Amanita pantherina", "correct": false}], "correct_answer": "B. Coprine atramentarius", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coprine atramentarius Coprine atramentous causes coprine food poisoning and usually presents as Antabuse/disulfiram-like reaction. The usual source of infection is contaminated butter with fungus.</p>\n<p><strong>Highyeild:</strong></p><p>Table: Common Causes of Mycetism Fungal species Claviceps purpurea (option A) Poisoning Ergot alkaloid Clinical condition St. Anthony's fire Inocybe fastigata (option C) Muscarine Cholinergic effect Amanita pantherina (Option D) Amanita phalloides Coprine atramentarius Ibotenic acid, muscimol Cycopeptide Coprine poisoning Abdominal pain, vomiting and diarrhoea Hepatocellular failure Disulfiram like reaction</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Claviceps purpurea-Ergot alkali Option C. Inocybe fastigata-Muscarine Option D. Amanita pantherina-Cycopeptide</p>\n<p><strong>Extraedge:</strong></p><p>Treatment. First-line treatment for invasive aspergillosis is voriconazole. Alternative treatments include lipid amphotericin formulations, posaconazole, isavuconazole, itraconazole, caspofungin, and micafungin.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old boy presented in emergency presents clinically with a disulfiram-like reaction. He had no history of drug abuse. He had a history of consumption of Butter toast at the last meal which was suggestive of Mycetism. Which of the following is incorrect about Mycetism?", "options": [{"label": "A", "text": "Cholinergic effect is produced by Inocybe fastigata due to Muscarine poisoning.", "correct": false}, {"label": "B", "text": "Coprine atramentarius poisoning presents as a disulfiram-like reaction.", "correct": false}, {"label": "C", "text": "Ergot's position is due to Amanita pantherina.", "correct": true}, {"label": "D", "text": "Edible mushroom is the usual source of infection of Amanita phalloides", "correct": false}], "correct_answer": "C. Ergot's position is due to Amanita pantherina.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ergot's position is due to Amanita pantherina. Ergot poisoning is caused by Claviceps purpurea.</p>\n<p><strong>Highyeild:</strong></p><p>Table: Common Causes of Mycetism Fungal species Claviceps purpurea (option A) Poisoning Ergot alkaloid Clinical condition St. Anthony's fire Inocybe fastigata (option C) Muscarine Cholinergic effect Amanita pantherina (Option D) Amanita phalloides Coprine atramentarius Ibotenic acid, muscimol Cycopeptide Coprine poisoning Abdominal pain, vomiting and diarrhoea Hepatocellular failure Disulfiram like reaction</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- All options except option C are correct statements</p>\n<p><strong>Extraedge:</strong></p><p>Claviceps purpurea is an ergot fungus that grows on the ears of rye and related cereal and forage plants. Consumption of grains or seeds contaminated with the survival structure of this fungus, the ergot sclerotium, can cause ergotism in humans and other mammals.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 30-year-old man has increased muscle weakness and numbness that started in his legs and feet 4 days ago and that now has progressed to his arms and hands. The patient has a history of having a self-limited episode of gastroenteritis. All are true about organisms commonly associated with this patient’s neurologic symptoms except?", "options": [{"label": "A", "text": "Gram-negative bacteria", "correct": false}, {"label": "B", "text": "Causes non inflammatory diarrhoea", "correct": true}, {"label": "C", "text": "Skirrow media is used to culture", "correct": false}, {"label": "D", "text": "Motile bacteria", "correct": false}], "correct_answer": "B. Causes non inflammatory diarrhoea", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Causes non inflammatory diarrhoea Symptoms of this patient suggest a diagnosis of Guillain Barre syndrome which commonly Occurs after infection of Campylobacter jejuni. It causes inflammatory Diarrhoea. Campylobacter jejuni is a gram-negative rod-shaped bacterium that grows best in a high temperature (42 degrees C, or 107 degrees F) and low oxygen environment. These characteristics represent adaptations to growth in its normal habitat—the intestine. Symptomatic infection occurs almost exclusively in infants and young children, who can be infected repeatedly. Subsequent infections tend to be asymptomatic, making symptomatic disease rare in older children or adults. To culture, this bacteria charcoal-based media like Butzler, and Skirrow is used. Infection is typically established in the lower intestines and colon, and initially causes noninflammatory diarrhoea. This is followed by a locally invasive stage that leads to cell damage and intestinal inflammation (dysentery), stomach cramps, and severe diarrhoea Campylobacter infections can cause extraintestinal diseases involving the neurologic, pulmonary, immunologic and cardiac systems . The main recognized sequelae are Guillain-Barré Syndrome (GBS), reactive arthritis (REA), and post-infectious irritable bowel syndrome (P-IBS).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Guillain-Barre syndrome is caused by Campylobacter jejuni which is a gram-negative rod. Option C. Skirrow Media is used to culture C. j It contains vancomycin, polymyxin B and trimethoprim to inhibit the growth of other bacteria. Option D. jejuni is a motile, with a single polar flagellum gram-negative rods with a comma, S or “gull-wing” shapes and they do not form spores.</p>\n<p><strong>Extraedge:</strong></p><p>Guillain-Barré syndrome (GBS) is a rare condition in which a person's immune system attacks the peripheral nerves. People of all ages can be affected, but it is more common in adults and in males. Most people recover fully from even the most severe cases of Guillain-Barré syndrome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An infant presents to the emergency department due to difficulty breathing, constipation and anorexia. The mother gives a history of feeding the baby with honey. On examination, the physician notes paralysis. A toxin screen of the stool identified the agent. Which of the following statements is false regarding the condition?", "options": [{"label": "A", "text": "This condition is caused by an exotoxin", "correct": false}, {"label": "B", "text": "The toxin type G is associated with sudden death", "correct": false}, {"label": "C", "text": "Detection of antitoxin can aid in the diagnosis", "correct": false}, {"label": "D", "text": "The toxin causes spastic paralysis by blocking the release of Acetylcholine", "correct": true}], "correct_answer": "D. The toxin causes spastic paralysis by blocking the release of Acetylcholine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The toxin causes spastic paralysis by blocking the release of Acetylcholine The classical history and clinical findings of paralysis with difficulty breathing are suggestive of infant botulism. Also known as floppy baby syndrome. The flaccid paralysis is due to a toxin that blocks the release of Acetylcholine.</p>\n<p><strong>Highyeild:</strong></p><p>Infant Botulism It affects infants, usually below 6 months. Occurs due to ingestion of food contaminated by spores of Cl, botulinum. Honey has been incriminated as a source of infection. It is a toxico-infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Botulinum produces a powerful exotoxin . Option B . The toxin type G is associated with sudden death Option C. Retrospective diagnosis can be made by detection of antitoxin in serum but not in all cases.</p>\n<p><strong>Extraedge:</strong></p><p>A type of bacteria called Clostridium botulinum produces the toxin. Botulism can occur as the result of food or wound contamination. The condition can also occur when bacterial spores grow in the intestines of infants. In rare cases, botulism can also be caused by medical treatment or bioterrorism.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 18-year-old male presented to the OPD with acute onset weakness in both the lower limbs which was suggestive of descending paralysis after 3 days of intake of canned food. He also gives a history of blurring of vision for the same duration. On examination, the patient has quadriparesis with areflexia. Both the pupils are non-reactive. Based on the given findings, the most probable diagnosis is?", "options": [{"label": "A", "text": "Poliomyelitis", "correct": false}, {"label": "B", "text": "Botulism", "correct": true}, {"label": "C", "text": "Guillain Barre Syndrome", "correct": false}, {"label": "D", "text": "Tetanus", "correct": false}], "correct_answer": "B. Botulism", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Botulism History of intake of canned food, descending paralysis, quadriparesis, and areflexia are suggestive of botulism.</p>\n<p><strong>Highyeild:</strong></p><p>Tetanus Botulism Susceptible species Horses, goats, sheep Horses, cattle, waterfowl Causative organism Clostridium tetani Clostridium botulinum Type of disease Infection Intoxication Etiology Bacteria enters infected wound and releases toxin (10-14 day incubation period) Organism lives on decaying plant or animal tissue and releases toxin, which is ingested* Signs of disease Muscular rigidity, muscle spasms, lockjaw, flickering third eyelid Paralysis, flaccid tongue Treatment Quiet, dark stall, toxoid and antitoxin, wound care/antibiotics (penicillin) Antitoxin (expensive, difficult to obtain), supportive care Prevention Annual vaccination with toxoidt,boosters after penetrating wound, appropriate wound management Monitor feed quality, cover burial sites</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Polio weakness is generally asymmetric , is proximal more than distal and may involve legs. Option C. Guillain Barre Syndrome usually causes ascending flaccid paralysis Option D. Tetanus causes spastic paralysis.</p>\n<p><strong>Extraedge:</strong></p><p>symptoms of botulism Symptoms Difficulty swallowing. Muscle weakness. Double vision. Drooping eyelids. Blurry vision. Slurred speech. Difficulty breathing. Difficulty moving the eyes.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 5-month-old boy is brought to the emergency department due to poor feeding, weakness, and complete loss of extremity muscle tone. Vaccinations are up to date, and there is no significant medical history. The patient receives formula as his sole source of nutrition except for occasional fruit juice and honey. Which of the following is most likely to confirm the diagnosis in this patient?", "options": [{"label": "A", "text": "Blood test for liver enzymes", "correct": false}, {"label": "B", "text": "Blood test for viral tilers", "correct": false}, {"label": "C", "text": "Stool test for bacterial toxins", "correct": true}, {"label": "D", "text": "Stool test for occult blood", "correct": false}], "correct_answer": "C. Stool test for bacterial toxins", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Stool test for bacterial toxins This 5-month-old patient ha s consumed honey, a food notorious for contamination with Clostridium botulinum spores. When an infant consumes C botulinum spores, the bacteria can germinate in the gastrointestinal tract. Bacteriolysis releases botulinum toxin, which is absorbed systemically and blocks the release of acetylcholine from cholinergic presynaptic terminals .</p>\n<p><strong>Highyeild:</strong></p><p>Constipation is usually the first manifestation of infant botulism, followed days to weeks later by mild weakness, lethargy, and reduced feeding. In rare, severe cases, infants can have weakened suckling and crying, diminished gag reflex, and symmetric, descending flaccid paralysis with loss of head control that can cause the infant to appear \"floppy.\" In contrast, adult botulism usually results from the ingestion of preformed toxins (eg, contaminated canned foods) and is almost always very severe. While infant botulism can be diagnosed based on clinical presentation and food consumption history, the diagnosis is usually confirmed through the identification of C. botulinum spores or toxins in stool samples.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Measurement of blood liver enzyme levels can indicate damage to hepatic cells in hereditary fructose intolerance (genetic deficiency in aldolase B). Although patients with fructose intolerance can have poor feeding shortly after juice and honey are added to the diet, other classic manifestations include hypoglycemia, vomiting, and hepatomegaly rather than loss of extremity muscle tone. Option B. Serum viral tilers are frequently used in the evaluation of patients with viral hepatitis or suspected Epstein-Barr or cytomegalovirus infections. Poor feeding with loss of extremity muscle tone is more characteristic of infant botulism. Option D: Allergic proctocolitis in infants can present after the introduction of different food groups, and the diagnosis can be supported by stool studies that are positive for gross or occult blood. However, these infants usually appear well despite persistent diarrhoea and/or rectal bleeding.</p>\n<p><strong>Extraedge:</strong></p><p>Wound botulism results from the contamination of a wound with the bacteria, which then secrete the toxin into the bloodstream. This has become more common in intravenous drug users since the 1990s, especially people using black tar heroin and those injecting heroin into the skin rather than the veins.[1] Wound botulism accounts for 29% of cases.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 27-year-old man comes to the emergency department due to several hours of right foot pain and swelling. Last night, he was working in the barn and stepped on an old nail. This morning, the patient awoke with right foot pain near the injury site that has increased throughout the day and is accompanied by progressive swelling. He has no significant past medical history and takes no medications. Temperature is 38.1 C (100.6 F), blood pressure is 135/75 mm Hg, and pulse is 95/min. The right foot is swollen with some erythema around the injury site. Radiographic imaging reveals gas in the tissues. On urgent surgical exploration, extensive tissue necrosis is present. Culture from the site reveals gram-positive rods. Which of the following best describes the mechanism of action of the toxin responsible for the necrotic effects seen in this patient?", "options": [{"label": "A", "text": "Actin depolymerisation", "correct": false}, {"label": "B", "text": "Carbohydrate degradation", "correct": false}, {"label": "C", "text": "Elongation factor ribosylation", "correct": false}, {"label": "D", "text": "Phospholipid splitting", "correct": true}], "correct_answer": "D. Phospholipid splitting", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Phospholipid splitting This patient likely has gas gangrene due to Clostridium perfringens (toxin-producing gram-positive rods}. Lecithinase is the main toxin of C perfringens; its concentration correlates with its lethal and necrotic effects.</p>\n<p><strong>Highyeild:</strong></p><p>Lecithinase, also known as phospholipase C or alpha toxin, catalyzes the splitting of phospholipid molecules . It hydrolyses lecithin-containing lipoprotein complexes in cell membranes, causing cell lysis (including erythrocyte hemolysis), tissue necrosis, and edema. (In contrast, human phospholipase A2 catalyzes arachidonic acid release from phospholipid cell membranes in the first step of leukotriene, thromboxane, and prostaglandin synthesis.) C perfringens has at least 12 toxins, of which phospholipase C is the most injurious.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Actin depolymerization and inhibition of presynaptic acetylcholine release are the mechanisms of action of C difficile cytotoxin B and C botulinum, botulinum toxin, respectively. Option B. C perfringens uses carbohydrates for energy. Its rapid metabolism of muscle tissue carbohydrates produces significant amounts of gas, which can be demonstrated radiographically by plain film X-ray or CT scan. Option C. Inactivation of elongation factor-2 through ribosylation describes the mechanism of action for diphtheria toxin.</p>\n<p><strong>Extraedge:</strong></p><p>Symptoms of Clostridium perfringens Symptoms of C. perfringens food poisoning include intense abdominal cramps and watery diarrhea. Your symptoms usually appear 6 to 24 hours after eating foods containing large numbers of C.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which bacterium can be the source of a neurotoxin that belongs to the AB toxin family and causes flaccid paralysis?", "options": [{"label": "A", "text": "C. diphtheriae", "correct": false}, {"label": "B", "text": "C. botulinum", "correct": true}, {"label": "C", "text": "C. tetani", "correct": false}, {"label": "D", "text": "V. cholera", "correct": false}], "correct_answer": "B. C. botulinum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. botulinum Clostridium botulinum is a Gram-positive, rod-shaped, anaerobic, spore-forming, motile bacterium with the ability to produce the neurotoxin botulinum. The AB toxins are two-component protein complexes secreted by a number of pathogenic bacteria. They can be classified as Type III toxins because they interfere with internal cell function.</p>\n<p><strong>Highyeild:</strong></p><p>Botulism is a disease caused by this neurotoxin specifically A, B, E, or F type neurotoxin, symptoms include flaccid paralysis weakness or slackness in various muscles. Bacteria called Clostridium botulinum produce the neurotoxin . The neurotoxin paralyzes muscles and can be life threatening.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Cause Diphtheria which leads to pseudomembrane formation and polyneuropathies. Option C. Cause Tetnus - manifests as spastic paralysis. Option D. Cause cholera- manifest as massive diarrhoea.</p>\n<p><strong>Extraedge:</strong></p><p>A rare poisoning caused by toxins produced by Clostridium botulinum bacteria. Botulism can be fatal and requires emergency medical care. It can occur in infants, be spread in food or infect a wound. Symptoms include difficulty swallowing or speaking, facial weakness and paralysis. Treatments are an antitoxin injection and breathing assistance.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Main site of action of tetanus toxin-", "options": [{"label": "A", "text": "Presynaptic terminal of spinal cord", "correct": true}, {"label": "B", "text": "Post-synaptic terminal of spinal cord", "correct": false}, {"label": "C", "text": "Neuromuscular junction", "correct": false}, {"label": "D", "text": "Muscle fibres", "correct": false}], "correct_answer": "A. Presynaptic terminal of spinal cord", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Presynaptic terminal of spinal cord Tetanus toxin is an extremely potent neurotoxin produced by the vegetative cell of Clostridium tetani in anaerobic conditions, causing tetanus. It has no known function for clostridia in the soil environment where they are normally encountered. It is also called a spasmogenic toxin, or TeNT.</p>\n<p><strong>Highyeild:</strong></p><p>Tetanus toxin (tetanospasmin)->acts on pre-synaptic membrane-> Decreases in neurotransmitter (GABA and glycine) release from the inhibitory neurons → Spastic paralysis The spastic paralysis induced by the toxin is due to the blockade of neurotransmitter release from spinal inhibitory interneurons.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C & D. Main site of action for tetanus toxin is the presynaptic terminal of the spinal cord. It then migrates to the retrograde axonal transport system to the cell bodies of these neurons to the spinal cord and brainstem.</p>\n<p><strong>Extraedge:</strong></p><p>Tetanus toxin: MOA Tetanospasmin released in the wound is absorbed into the circulation and reaches the ends of motor neurons all over the body. The toxin acts at several sites within the central nervous system, including nerve terminals, the spinal cord, a nd brain , and within the sympathetic nervous system. By binding to peripheral motor neuron terminals, the toxin enters the nerve axons, and is transported across synaptic junctions to the nerve-cell body in the brain stem and spinal cord by retrograde intraneuronal transport, until it reaches the central nervous system, where it rapidly binds to gangliosides at the pre- synaptic membrane of inhibitory motor nerve endings. The clinical manifestations of tetanus are caused when tetanus toxin blocks inhibitory impulses, by interfering with the release of neurotransmitters, including glycine and gamma-aminobutyric acid. These inhibitory neurotransmitters inhibit the alpha motor neurons. With diminished inhibition, the resting firing rate of the alpha motor neuron increases, producing rigidity, unopposed muscle contraction and spasm.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Corynebacterium diphtheriae toxin acts by:", "options": [{"label": "A", "text": "Inhibition of protein synthesis", "correct": true}, {"label": "B", "text": "Competitive inhibition of cytochrome", "correct": false}, {"label": "C", "text": "Killing susceptible cells", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. Inhibition of protein synthesis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inhibition of protein synthesis Diphtheria toxin kills cells by inhibiting eukaryotic protein synthesis , and its mechanism of action has been extensively characterized. Diphtheria toxin was the first member to be identified of a group of bacterial protein toxins that act by ADP-ribosylation of a target protein. The toxin acts by inhibiting cellular protein synthesis by ribosylation of adenosine diphosphate leading to the inactivation of elongation factor 2. DT is the primary virulence factor responsible for diphtheria: It has two fragments: Fragment A (active unit) and B (binding unit) Fragment B binds to the host cell receptors (such as epidermal growth factor) and helps in the entry of fragment A. Fragment A is internalized into the host cells and then causes→ ADP ribosylation of elongation factor 2(EF2)→ inhibition of EF2→ irreversible inhibition of translation step of protein synthesis→ cell death. The mechanism of DT is similar to exotoxin A of Pseudomonas.</p>\n<p><strong>Highyeild:</strong></p><p>Diphtheria toxin: mode of action Same as P. aeruginosa Exotoxin A ADP-ribosyl transferase Inactivates elongation factor 2 Inhibits host protein synthesis</p>\n<p><strong>Extraedge:</strong></p><p>Mechanism of action Diphtheria toxin blocks protein elongation by binding EF2 elongation factor EF2+ NAD > ADP-ribose-dipthamide-EF2 Nicotinamide. H By removing EF2 from the intracellular environment, it blocks the transition between A site and P site in the ribosome. This factor is required for translocation of polypeptidyl transfere RNA from the acceptor to the donor site on the eukaryotic ribosome. Thus preventing protein synthesis leading to cell death. Diphteria toxin has an extremely low lethal dose. It is a heat-labile polypeptide that can be lethal in a dose of 0.1 ug/kg. Toxin is lethal in human beings in an amount 130µg/kg BW</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The mechanism of action of the exotoxin produced by Corynebacterium diphtheriae can be characterized by which of the following?", "options": [{"label": "A", "text": "Acting as a superantigen that binds to MHC class II protein and the T-cell receptor.", "correct": false}, {"label": "B", "text": "Blocking the release of acetylcholine causes anticholinergic symptoms.", "correct": false}, {"label": "C", "text": "Blocking the release of glycine (inhibitory neurotransmitter).", "correct": false}, {"label": "D", "text": "Inhibits protein synthesis via EF-2 adenosine diphosphate (ADP) ribosylation.", "correct": true}], "correct_answer": "D. Inhibits protein synthesis via EF-2 adenosine diphosphate (ADP) ribosylation.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inhibits protein synthesis via EF-2 adenosine diphosphate (ADP) ribosylation. Diphtheria toxin is an exotoxin secreted by Corynebacterium, the pathogenic bacterium that causes diphtheria.</p>\n<p><strong>Highyeild:</strong></p><p>The toxin causes the disease in humans by gaining entry into the cell cytoplasm and inhibiting protein synthesis. Diphtheria toxin kills cells by inhibiting eukaryotic protein synthesis, and its mechanism of action has been extensively characterized. This potent toxin inactivates the elongation factor (EF-2) required for protein synthesis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. Are incorrect as Corynebacterium diphtheriae inhibits protein synthesis via EF-2 adenosine diphosphate (ADP) ribosylation.</p>\n<p><strong>Extraedge:</strong></p><p>Diphtheria toxin: mode of action Same as P. aeruginosa Exotoxin A ADP-ribosyl transferase Inactivates elongation factor 2 Inhibits host protein synthesis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about Corynebacterium diphtheriae is all except:", "options": [{"label": "A", "text": "Iron is not required for toxin production", "correct": true}, {"label": "B", "text": "Toxin production is responsible for local reaction", "correct": false}, {"label": "C", "text": "Non-sporing, non-capsular & non-motile", "correct": false}, {"label": "D", "text": "Toxin production is by lysogenic conversion", "correct": false}], "correct_answer": "A. Iron is not required for toxin production", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Iron is not required for toxin production Corynebacterium diphtheriae is the bacterium that causes the disease diphtheria. Corynebacterium diphtheriae is a rod-shaped, Gram-positive, non-spore-forming, and nonmotile bacterium . Diphtheria toxin is an exotoxin secreted by Corynebacterium, the pathogenic bacterium that causes diphtheria. Diphtheria produces diphtheria toxin, a protein that inhibits protein synthesis in susceptible eukaryotic cells. Diphtheriae will synthesize diphtheria toxin as 5% of its total protein . The tox gene is regulated by a mechanism of negative control wherein a repressor molecule, a product of the DtxR gene, is activated by iron. Must Remember - Iron concentration: Toxin production depends on optimum iron concentration (0.1 mg per litre). Higher levels of iron inhibit toxin synthesis by up-regulating the DT repressor gene in the bacterial chromosome.</p>\n<p><strong>Highyeild:</strong></p><p>Diphtheria toxin: mode of action Same as P. aeruginosa Exotoxin A ADP-ribosyl transferase Inactivates elongation factor 2 Inhibits host protein synthesis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Diphtheriae toxin is a heat-liable, single-chain, three-domain polypeptide that can be lethal in a dose of 0.1mg/kg body weight. The abrupt arrest of protein synthesis is responsible for the necrotizing and neurotoxic effects of diphtheria toxin. Option C. Corynebacterium diphtheriae is a non-motile, non-sporing, non-capsular bacteria. It is 0.5-1.0 mg in diameter and several micrometres long. Characteristically they possess irregular swellings at one end that give them a club-shaped appearance. Option D. Diphtheriae that carry the lysogenic bacteriophage are toxigenic</p>\n<p><strong>Extraedge:</strong></p><p>Virulence Factors Diphtheria toxin Diphtheria toxin gene is encoded by a bacteriophage Phage Beta DT inhibits of protein synthesis (clongation factor 2) C. Diphtheria without this gene is not as harmful Repressor (DtxR) gene, is activated by iron and prevents transcription of the tox gene High iron levels = no toxin release Low iron levels = toxins released</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is least likely with a severe infection with Corynebacterium diphtheria?", "options": [{"label": "A", "text": "Myocardial degeneration", "correct": false}, {"label": "B", "text": "Septicaemia", "correct": true}, {"label": "C", "text": "Peripheral neuritis", "correct": false}, {"label": "D", "text": "Asphyxia", "correct": false}], "correct_answer": "B. Septicaemia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Septicaemia Diphtheria is toxaemia not bacteraemia. Corynebacterium diphtheriae is the bacterium that causes the disease diphtheria. Corynebacterium diphtheriae is a rod-shaped, Gram-positive, non-spore-forming, and nonmotile bacterium . The disease occurs primarily in tropical regions and underdeveloped countries but has been known to appear throughout the world.</p>\n<p><strong>Highyeild:</strong></p><p>Diphtheria bacteria usually spread from person to person through respiratory droplets, like from coughing or sneezing. Diphtheria is a serious infection caused by strains of bacteria called Corynebacterium diphtheriae that make a toxin (poison). It is a toxin that can cause people to get very sick.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. C. diphtheriae produces a toxin in the membrane actively it is absorbed and results in distant toxic damage, particularly parenchymatous degeneration, fatty infiltration and necrosis of heart muscles (myocarditis) Option C. C. diphtheriae toxin also produces nerve damage (de-myelination) , often resulting in paralysis of the soft palate, eye muscles or extremities (peripheral neuritis). Option D. When diphtheritic inflammation begins in the respiratory tract, sore throat and low-grade fever usually develop. Prostration and dyspnoea soon follow due to obstruction caused by a The obstruction may even cause suffocation if not promptly relieved by intubation or tracheostomy.</p>\n<p><strong>Extraedge:</strong></p><p>Corynebacterium is a genus of Gram-positive bacteria and most are aerobic. They are bacilli (rod-shaped), and in some phases of life they are, more specifically, club-shaped, which inspired the genus name (coryneform means \"club-shaped\").</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 21 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "All are true about the given image except:", "options": [{"label": "A", "text": "Bartonella henselae is a causative organism", "correct": false}, {"label": "B", "text": "It can't be cultured on standard culture media", "correct": true}, {"label": "C", "text": "No human-to-human transmission.", "correct": false}, {"label": "D", "text": "spread by cats", "correct": false}], "correct_answer": "B. It can't be cultured on standard culture media", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236440098-QTDV035001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It can't be cultured on standard culture media This organism can easily be cultured on standard culture media. It is a self-limiting infection characterized by lymphadenopathy, which may be accompanied by other unremarkable manifestations such as fever or fatigue. A few cases of meningoencephalitis, endocarditis and eye involvement (neuro retinitis), bacteremia, and neurological disorders have also been reported.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Image shows typical s tellate granuloma seen in cat scratch disease caused by Bartonella henselae . Options C and D. No human-to-human transmission is seen and spread by a Bartonella henselae causes infections that resemble febrile illness and chronic diseases such as tuberculosis and hematological malignancies. Options A, C, and D. Are correct statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Burkholderia cepacia is resistant to which of the following drugs:", "options": [{"label": "A", "text": "Ciprofloxacin", "correct": false}, {"label": "B", "text": "Ceftriaxone", "correct": false}, {"label": "C", "text": "Polymyxin B", "correct": true}, {"label": "D", "text": "Ampicillin", "correct": false}], "correct_answer": "C. Polymyxin B", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polymyxin B Intrinsic resistance of B. cepacia complex strains to aminoglycosides and polymyxin results from decreased site-specific binding of these cationic drugs. Burkholderia cepacia is an aerobic gram-negative bacillus found in various aquatic environments. B cepacia is an organism of low virulence and is a frequent colonizer of fluids used in the hospital (eg, irrigation solutions, intravenous fluids). Burkholderia cepacia is an aerobic gram-negative bacillus found in various aquatic environments. B cepacia is an organism of low virulence and is a frequent colonizer of fluids used in the hospital (e.g., irrigation solutions, and intravenous fluids). B cepacia rarely causes infection in healthy hosts. Members of the genus Burkholderia, which includes various human pathogens, are inherently resistant to antimicrobial peptides. The resistance is several orders of magnitude higher than other Gram-negative bacteria such as Escherichia coli, Salmonella enterica, or Pseudomonas aeruginosa.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Burkholderia cepacia is not resistant to these drugs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Negative staining demonstrates while +ve staining doesn't demonstrate capsule. This is because the capsule is composed of:", "options": [{"label": "A", "text": "LPS (lipopolysaccharides)", "correct": false}, {"label": "B", "text": "Polysaccharide", "correct": true}, {"label": "C", "text": "Protein", "correct": false}, {"label": "D", "text": "Fat", "correct": false}], "correct_answer": "B. Polysaccharide", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polysaccharide The bacterial capsule is usually a hydrated polysaccharide structure covering the cell wall's outer layer. In most bacteria, it is composed of monosaccharides linked together by glycosidic bonds.</p>\n<p><strong>Highyeild:</strong></p><p>Capsules do not absorb most basic dyes; therefore, a negative staining technique (staining around the cells) is typically used for capsule staining. The dye stains the background but does not penetrate the capsules, which appear like halos around the cell's borders. A positive capsule stain requires a mordan t that precipitates the capsule. Bacterial cell walls remove the paint by counterstaining it with dyes like crystal violet or methylene blue. Capsules appear colorless, with stained cells against a dark background. Must Know - Negative staining by modified India ink and nigrosin stain is used to demonstrate the capsule, which appears as refractile delineated clear space surrounding the round budding yeast cells against a black ground. Sensitivity is 60–70%.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Lipopolysaccharides (LPS) are large molecules consisting of a lipid and a polysaccharide that are bacterial toxins. They are composed of an O-antigen, an outer core, and an inner core, all joined by a covalent bond, and are found in the outer membrane of Gram-negative bacteria. LPS is a potent activator of the immune system and pyrogen (agent that causes fever). In severe cases, LPS can play a role in causing septic shock Option C & D. Capsules comprise gelatin (hard or soft) and nongelatin shells generally derived from hydrolysis of collagen (acid, alkaline, enzymatic, or thermal hydrolysis) from animal origin or cellulose-based. A positive capsule stain requires a mordant that precipitates the capsule.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Erythrasma is caused by:", "options": [{"label": "A", "text": "C. Diphtheria", "correct": false}, {"label": "B", "text": "C. jakeium", "correct": false}, {"label": "C", "text": "C. minutissimum", "correct": true}, {"label": "D", "text": "C.pseudotuberculosis", "correct": false}], "correct_answer": "C. C. minutissimum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. minutissimum The bacteria responsible for erythrasma are gram-positive, non-spore-forming, aerobic, or facultative bacilli called Corynebacterium minutissimum . Erythrasma may coexist with or be confused with other causes of intertrigo, including fungal infections such as tinea or Candida albicans (thrush). Erythrasma is a chronic superficial localized skin infection. Erythrasma is more common in warm, humid climates or in individuals with poor hygiene, increased sweating, obesity, diabetes, advanced age, and poor immune function.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. diphtheriae causes diphtheria which is a severe infection Option B. C. ulcerans cause a rare oropharyngeal diphtheria-like illness and extra pharyngeal infections.</p>\n<p><strong>Extraedge:</strong></p><p>IMPORTANT GRAM-POSITIVE RODS: Other Aerobic and Facultative Gram-Positive Bacilli ORGANISM FEATURES EPIDEMIOLOGY DISEASE Corynebacterium ulcerans Closely related to C. diphtheriae, including ability to produce small amounts of DT Similar to diphtheria, also infects animals Pharyngitis Erysipelothrix rhusiopathiae Multiresistant, often susceptible only to vancomycin Acquired from skin colonization Bacteremia, IV catheter colonization Erysipelothrix rhusiopathiae Resembles corynebacteria and Listeria Traumatic inoculation from animal and decaying organic matter Erysipeloid, painful, slow- spreading, erythematous swelling of skin. Occupational disease of fishermen, butchers, and veterinarians Lactobacillus spp Long, slender rods with squared ends, often chain end to end Normal oral, gastrointestinal, and vaginal flora No human infections L. acidophilus plays role in pathogenesis of dental caries Propionibacterium Resemble corynebacteria, anaerobes, or microaerophiles Normal skin flora Rare cause of bacterial endocarditis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A fisherman embedded a fish hook into his right forefinger. 5 days later, he had severe pain and nodular Swelling of the finger. On aspiration of the nodule, gram-positive bacilli produce greenish discoloration of blood agar. Likely cause:", "options": [{"label": "A", "text": "Klebsiella", "correct": false}, {"label": "B", "text": "Erysipelothrix rhusiopathiae", "correct": true}, {"label": "C", "text": "E.coli", "correct": false}, {"label": "D", "text": "Bartonella", "correct": false}], "correct_answer": "B. Erysipelothrix rhusiopathiae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Erysipelothrix rhusiopathiae Erysipelothrix is the only gram-positive organism among all the options; the rest are gram-negative. It causes erysipeloid skin lesion violaceous swelling with severe pain but no pus. The most common site is the finger (called ‘seal finger’ and ‘whale finger’).</p>\n<p><strong>Highyeild:</strong></p><p>Erysipelothrix rhusiopathiae is a Gram-positive, catalase-negative, rod-shaped, non-spore-forming, nonacid-fast, nonmotile bacterium. Distributed worldwide, E. rhusiopathiae has primarily considered an animal pathogen, causing the disease known as erysipelas that may affect many animals. Colonies are small with a narrow zone of alpha hemolysis on blood agar plates. Laboratory smears show Gram-positive rods (though Gram stain has low sensitivity for this microbe). It is nonmotile, catalase-negative, microaerophilic, capnophilic, and non-spore-forming. Catalase negative, H2S positive Treatment: DOC is penicillin G. However, it is intrinsically resistant to vancomycin. Erysipelothrix rhusiopathiae endocarditis in men is a sporadic disease. The bacteria growth- formation of small greenish colonies on blood agar, positive hydrogen sulfide, negative catalase, and green color.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "What is the most important virulence factor of Corynebacterium diphtheriae?", "options": [{"label": "A", "text": "Capsule", "correct": false}, {"label": "B", "text": "Pili", "correct": false}, {"label": "C", "text": "Diphtheria toxin", "correct": true}, {"label": "D", "text": "LPS", "correct": false}], "correct_answer": "C. Diphtheria toxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diphtheria toxin The toxin is a main virulence factor of C. diphtheriae is diphtheria toxin (DT), an exotoxin released by the bacteria after entering the human body. DT is classified as an AB toxin because it has two components: activation and binding. The pathogenesis of diphtheria is based on two primary determinants: (1) the ability of a given strain of C diphtheria to colonize in the nasopharyngeal cavity and on the skin, and (2) its ability to produce diphtheria toxin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. It is typically a hydrated polysaccharide complex that covers the outermost part of the cell wall and comprises monosaccharides joined together by glycosidic linkages in most bacteria. Option B. Pilus is a hair-like appendage found on the surface of many bacteria. Dozens of these structures can exist on the bacterial surface. Some bacteria, viruses, or bacteriophages attach to receptors on pili at the start of their reproductive cycle. Option D. The bacterial capsule is usually a hydrated polysaccharide structure covering the cell wall's outer layer. In most bacteria, it is composed of monosaccharides linked together via glycosidic bonds. Capsules comprise gelatin (hard or soft) and nongelatin shells generally derived from hydrolysis of collagen (acid, alkaline, enzymatic, or thermal hydrolysis) from animal origin or cellulose-based.</p>\n<p><strong>Extraedge:</strong></p><p>Pili are antigenic . They are also fragile and constantly replaced, sometimes with pili of different compositions, resulting in altered antigenicity. Specific host responses to old pili structures are ineffective in the new system. Recombination genes of pili code for the variable (V) and constant (C) regions of the pili (similar to immunoglobulin diversity). As the primary antigenic determinants, virulence factors, and impunity factors on the cell surface of several Gram-negative and some Gram-positive bacteria species, including Enterobacteriaceae, Pseudomonadaceae, and Neisseriaceae, there has been much interest in the study of pili as an organelle of adhesion and as vaccine components.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following statements are true about diphtheria except:", "options": [{"label": "A", "text": "Toxin production depends on lysogenic conversion by beta phage", "correct": false}, {"label": "B", "text": "Nonsporing, nonmotile, and encapsulated", "correct": false}, {"label": "C", "text": "Toxin detection is done by ELISA test enzyme-linked immunoassay.", "correct": false}, {"label": "D", "text": "Faucial diphtheria is Not the most typical type", "correct": true}], "correct_answer": "D. Faucial diphtheria is Not the most typical type", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Faucial diphtheria is Not the most typical type Faucial diphtheria is the most common type.</p>\n<p><strong>Highyeild:</strong></p><p>Corynebacterium diphtheriae is the bacterium that causes the disease diphtheria. Corynebacterium diphtheriae is a rod-shaped, Gram-positive, non-capsulated, and nonmotile bacterium. Toxin production depends on lysogenic conversion by beta phage. (option A) Diphtheria toxin is an exotoxin secreted by Corynebacterium, the pathogenic bacterium that causes diphtheria. Diphtheria produces diphtheria toxin, a protein that inhibits protein synthesis in susceptible eukaryotic cells. Detecting toxigenicity is the most crucial test for the microbiological diagnosis of diphtheria. PCR-based assay for detecting diphtheria toxin genes in isolates.- PCR has now primarily superseded phenotypic testing for toxigenicity and has been adapted to direct detection in specimens to provide a rapid presumptive laboratory diagnosis. Toxin demonstration should be done following isolation, which can be of two types; in vivo and in vitro: In vivo tests (Guinea pigs inoculation) by (i) subcutaneous test, (ii) Intracutaneous inoculation In vitro tests: Elek’s gel precipitation test Detection of a tox gene by PCR Polymerase Chain Reaction Option C. Detection of diphtheria toxin by ELISA or immunochromatographic test (ICT) Cytotoxicity produced on cell lines.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. Are true about diphtheria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "There is a constant increase in the number of bacterial cells during:", "options": [{"label": "A", "text": "Decline phase", "correct": false}, {"label": "B", "text": "Lag phase", "correct": false}, {"label": "C", "text": "Stationary phase", "correct": false}, {"label": "D", "text": "Exponential phase", "correct": true}], "correct_answer": "D. Exponential phase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Exponential phase Bacterial growth is the proliferation of bacteria into two daughter cells in a process called binary fission. The log phase, the logarithmic or exponential phase, is a period characterized by cell doubling. If growth is not limited, doubling will continue at a constant rate, so both the number of cells and the rate of population increase doubles with each consecutive period. The exponential phase is when the growth rate of the cells gradually increases; the cells grow at a constant, maximum rate. This period is known as the log, or exponential, phase; the increase in biomass concentration will be proportional to the initial biomass concentration.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. The no. of bacteria declines, as understood by the name Option C. The no. of bacteria remains the same Phase A is the lag phase, where there is no appreciable increase in the size of cells, though there may be an increase in the size of cells seen. Phase B is the log or exponential phase where cells start dividing, and their numbers increase exponentially or by geometric progression, not arithmetically. Phase C is the stationary phase where the Growth of new cells equals the death of old ones. Phase D is the phase of decline, where the population decreases due to cell death. The leading causes are nutritional exhaustion and toxic accumulation. Autolytic enzymes are one of the causes.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "DOC for shown organism?", "options": [{"label": "A", "text": "Penicillin G", "correct": false}, {"label": "B", "text": "Benzathine penicillin", "correct": false}, {"label": "C", "text": "Co-trimoxazole", "correct": true}, {"label": "D", "text": "Albendazole", "correct": false}], "correct_answer": "C. Co-trimoxazole", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236441139-QTDV035010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Co-trimoxazole The image shows an acid-fast ellipsoidal oocyst, characteristic of Isospora/cystoisospora belli. DOC for C.belli is Co- trimoxazole. The oocysts of C. belli are large (25 to 30 µm) and have a typical ellipsoidal shape. Co-trimoxazole is a combination of trimethoprim and sulfamethoxazole and is in a class of medications called sulfonamides.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. These are not the drug of choice for this shown organism</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following defines the relation between quality assurance (QA), quality control (QC), internal quality assurance (IQA) & external quality assurance (EQA):", "options": [{"label": "A", "text": "QA = QC + IQA + EQA", "correct": true}, {"label": "B", "text": "QC = QA + IQA - EQA", "correct": false}, {"label": "C", "text": "QC = QA + IQA + EQA", "correct": false}, {"label": "D", "text": "QA = QC + IQA - EQA", "correct": false}], "correct_answer": "A. QA = QC + IQA + EQA", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>QA = QC + IQA + EQA Quality Assurance. Quality Control. Definition. QA is the implementation of processes, methodologies, and standards that ensure that the software developed will be up to the required quality standards. Quality Control Definition- QC is the set of activities that are carried out to verify the developed product meets the required standards. The difference between quality assurance and testing is that quality assurance is about the activities designed to ensure the project conforms to the stakeholders' expectations. At the same time, the test is a process of exploring a system to find defects. Whereas QA is proactive, QC is reactive. Testing is a subset of QC. It is the process of executing a system to detect bugs in the product so that they get fixed. Testing is an integral part of QC as it helps demonstrate that the product runs how it is expected and designed for. QUALITY ASSURANCE AND QUALITY CONTROL- QA= QC+ EQA+IQA specimen.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "QC is applied to which phase of laboratory testing?", "options": [{"label": "A", "text": "Preanalytical phase", "correct": false}, {"label": "B", "text": "Analytical phase", "correct": true}, {"label": "C", "text": "Post Analytical phase", "correct": false}, {"label": "D", "text": "Any phase", "correct": false}], "correct_answer": "B. Analytical phase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Analytical phase Quality control is a process by which entities review the quality of all factors involved in production. Quality control is \"A part of quality management focused on fulfilling quality requirements.\" Quality control (QC) is a process through which a business seeks to maintain or improve product quality. Quality control involves testing units and determining if they are within the specifications for the final product. The accreditation and inspection processes maintain quality standards, along with proficiency testing. It is well documented that most laboratory errors occur in the pre-and post-analytical phases. In contrast, less than 10 percent of all errors in clinical laboratories arise in the testing phase.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following factors released by heating a suspension of sheep erythrocytes is required to grow Haemophilus influenzae in chocolate agar?", "options": [{"label": "A", "text": "Hemin", "correct": false}, {"label": "B", "text": "Nicotinamide adenine dinucleotide (NAD)", "correct": true}, {"label": "C", "text": "Hemoglobin", "correct": false}, {"label": "D", "text": "Hemolysin", "correct": false}], "correct_answer": "B. Nicotinamide adenine dinucleotide (NAD)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nicotinamide adenine dinucleotide (NAD) NAD is present inside RBCs and released by heating a suspension of sheep erythrocytes and is required for the growth of Haemophilus influenzae in chocolate agar. influenzae are tiny, pleomorphic, gram-negative bacilli or coccobacilli with random arrangements. The standard medium used for the growth of H. influenzae is a chocolate agar plate (CAP), which can be prepared with heat-lysed horse blood, a good source of both hemin and NAD, although sheep blood can also be used. Chocolate agar is used for growing fastidious respiratory bacteria, such as Haemophilus influenza. Chocolate agar is essentially the same as blood agar, except that NAD is needed for the isolation of fastidious organisms, such as H. influenzae</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Hemin is present in blood and is also required for the growth of Haemophilus influenzae in chocolate agar. Options C and D. are not required for the growth of Haemophilus influenzae.</p>\n<p><strong>Extraedge:</strong></p><p>Haemophilus species are Gram-negative coccobacilli similar in ultrastructural features to other pathogenic bacilli. Haemophilus influenzae requires hemin (factor X) and NAD+ (factor V) for growth. Other Haemophilus species require only NAD+ and therefore grow on blood agar.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "DT104 strain belongs to which of the following?", "options": [{"label": "A", "text": "Salmonella Typhi", "correct": false}, {"label": "B", "text": "Salmonella Paratyphi A", "correct": false}, {"label": "C", "text": "Salmonella gallinarum", "correct": false}, {"label": "D", "text": "Salmonella typhimurium", "correct": true}], "correct_answer": "D. Salmonella typhimurium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Salmonella typhimurium Multidrug-resistant human and animal Salmonella typhimurium isolates in France belong predominantly to a DT104 clone with the chromosome- and integron-encoded β-lactamase PSE-1. DT104 strains are commonly known to be Penta-resistant, exhibiting resistance to ampicillin, chloramphenicol, streptomycin, sulfamethoxazole, and tetracycline.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. DT104 belongs to S. Typhimurium; hence these options are incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which is an accurate description of the morphology of the virulent form of Cryptococcus?", "options": [{"label": "A", "text": "Broad-based, budding yeasts", "correct": false}, {"label": "B", "text": "Budding yeasts in a \"pilot's wheel\" arrangement", "correct": false}, {"label": "C", "text": "Cylindrical arthroconidia", "correct": false}, {"label": "D", "text": "Encapsulated budding yeasts", "correct": true}], "correct_answer": "D. Encapsulated budding yeasts", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Encapsulated budding yeasts Cryptococcus is an invasive fungus that causes cryptococcosis, an infection commonly associated with immunosuppressive individuals but rare in healthy individuals. The two species of Cryptococcus commonly associated with infections in humans are Cryptococcus neoformans and Cryptococcus gatti. Cryptococcosis is caused by a fungus known as Cryptococcus neoformans. The infection may be spread to humans through contact with pigeon droppings or unwashed raw fruit. Contact with an infected individual may also spread the infection. Cryptococcus neoformans is an encapsulated yeast and obligate aerobe that can live in plants and animals. Its teleomorph is Filobasidiella neoformans, a filamentous fungus in Tremellomycetes. It is often found in bird excrement.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Broad-based, budding yeasts- seen in Blastomyces. Option B. Budding yeasts in a \"pilot's wheel\" arrangement in Paracoccidioides. Option C. Cylindrical arthroconidia- seen in Coccidioides.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Sexual method of reproduction is by conjugation in:", "options": [{"label": "A", "text": "Ciliata", "correct": true}, {"label": "B", "text": "Nematodes", "correct": false}, {"label": "C", "text": "Cestodes", "correct": false}, {"label": "D", "text": "Plasmodium", "correct": false}], "correct_answer": "A. Ciliata", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ciliata T he ciliates are a group of protozoans characterized by hair-like organelles called cilia, which are identical in structure to eukaryotic flagella but generally shorter and shorter present in much larger numbers, with a different undulating pattern than flagella. Ciliates are single-celled organisms that possess cilia, short hairlike organelles used for locomotion and food gathering at some stage in their life cycle. During conjugation (sexual reproduction), two ciliates come in contact, forming a cytoplasmic bridge between them. Ciliates reproduce asexually by division: the micronucleus undergoes mitosis, while in most ciliates, the macronucleus simply pinches apart into two. However, ciliates also reproduce sexually through a process known as conjugation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option C. They can reproduce sexually either through self-fertilization or cross-fertilization with another tapeworm Option D. Plasmodium follows the asexual mode of reproduction by multiple fission</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Lysogenic conversion is seen in:", "options": [{"label": "A", "text": "Diphtheria", "correct": true}, {"label": "B", "text": "Salmonella", "correct": false}, {"label": "C", "text": "Staphylococcus", "correct": false}, {"label": "D", "text": "E. coli", "correct": false}], "correct_answer": "A. Diphtheria", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diphtheria The toxigenicity of diphtheria bacilli depends on the presence of corynephages. Those strains of the bacterium which are not infected with the virus do not produce the toxin. Non-toxigenic anxieties may be rendered toxigenic by infecting them with the beta phage. This is known as lysogenic conversion.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C & D. Lysogenic conversion is not usual in Salmonella, Staphylococcus, or E coli.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ehrlich phenomenon is seen in:", "options": [{"label": "A", "text": "M. tuberculosis,", "correct": false}, {"label": "B", "text": "C. diphtheriae", "correct": true}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Mycoplasma", "correct": false}], "correct_answer": "B. C. diphtheriae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C. diphtheriae The difference between the amount of diphtheria toxin that will exactly neutralize one unit of antitoxin and that which, added to one Team of anti-toxin, will leave one lethal dose free is more significant than one lethal dose of toxin; i.e., it is necessary to add more than one lethal dose of poison to a neutral mixture of toxin and antitoxin to make the mix deadly. This is known as the Ehrlich phenomenon.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C & D. Incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about Bacillus Anthracis except?", "options": [{"label": "A", "text": "McFadyean's reaction is used in the presumptive diagnosis of anthrax infection", "correct": false}, {"label": "B", "text": "Medusa head appearance of colonies in gelatin stab culture", "correct": true}, {"label": "C", "text": "PLET is the selective medium", "correct": false}, {"label": "D", "text": "Ascoli's thermo precipitation test is used for laboratory diagnosis", "correct": false}], "correct_answer": "B. Medusa head appearance of colonies in gelatin stab culture", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Medusa head appearance of colonies in gelatin stab culture Medusa head colonies are seen on a gar plate culture when viewed under lower power in a microscope because the edge of the territory is composed of long interlacing chains of bacilli. In contrast, an inverted fir tree appearance is seen in gelatin stab culture.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Blood films of infected animals on staining with polychrome methylene blue show an amorphous purplish material around the chains of bacilli. This is called the Mcfadyean reaction. Option C. Selective medium for bacillus is Polymyxin-lysozyme-EDTA-thallous acetate medium. Option D. Ascoli’s thermo precipitation test is also used for laboratory diagnosis of anthrax.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Malignant pustule is a term for?", "options": [{"label": "A", "text": "Anthrax ulcer", "correct": true}, {"label": "B", "text": "Proliferating rodent ulcer", "correct": false}, {"label": "C", "text": "Malignant melanoma", "correct": false}, {"label": "D", "text": "Marjolin's ulcer", "correct": false}], "correct_answer": "A. Anthrax ulcer", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anthrax ulcer ZBacillus anthracis causes anthrax, and the disease may be seen in three forms: Cutaneous b. Pulmonary c. Intestinal Cutaneous is the most common form (malignant pustule, Hide porter’s disease) A painless congested edematous ulcer area with central necrosis and surrounding black eschar and satellite lesions is called a “malignant pustule.” All three forms can lead to fatal septicemia Infection in humans: permanent immunity Treatment- Parenteral Doxy/Ciprofloxacin initially and then oral with antibiotics like Rifampicin/Vanco/ampicillin for 60 days.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Rodent ulcer is another name for a cutaneous malignancy, basal cell carcinoma. Option C, D. Malignant melanoma and Marjolin’s ulcer are also examples of cutaneous malignancy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the organisms in the image stained with positive dark-field examination:", "options": [{"label": "A", "text": "Treponema Pallidum", "correct": true}, {"label": "B", "text": "H Influenza", "correct": false}, {"label": "C", "text": "Pseudomonas aeruginosa", "correct": false}, {"label": "D", "text": "B anthracis", "correct": false}], "correct_answer": "A. Treponema Pallidum", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236441728-QTDV035023IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Treponema Pallidum Positive dark-field examination. Treponemes are recognizable by their characteristic corkscrew shape and deliberate forward and backward movement with rotation about the longitudinal axis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C & D. These can be stained with gram stain and seen with a bright field microscope.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Rotation of flagella in bacteria is driven by the flow of:", "options": [{"label": "A", "text": "Electrons", "correct": false}, {"label": "B", "text": "Protons", "correct": true}, {"label": "C", "text": "Both electrons and protons", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "B. Protons", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Protons Structural components within the basal body of the flagellum allow the inner portion of this structure, the rods of the basal body, and the attached hook–filament complex to rotate. The outer rings remain statically in contact with the inner and outer cell membranes and cell walls (murein), anchoring the flagellum complex to the bacterial cell envelope. Rotation is driven by the flow of protons through the motor from the periplasmic space, outside the cell membrane, into the cytoplasm in response to the electric field and proton gradient across the membrane, which together constitute the proton motive force. A switch determines the direction of rotation, which determines whether the bacteria swim forward (by counterclockwise rotation of the flagellum) or tumble.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Incorrect as rotation is proton and not electrons gradient driven.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The cell wall of gram negative organism contains:", "options": [{"label": "A", "text": "Lipopolysaccharides", "correct": true}, {"label": "B", "text": "Techoic acid", "correct": false}, {"label": "C", "text": "Both of the above", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Lipopolysaccharides", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lipopolysaccharides Structures present in gram-negative bacteria but absent in gram-positive bacteria include: the outer membrane, lipopolysaccharide, fimbriae (piand li), and periplasmic space.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Structure only present in gram-positives includes teichoic acid-cell membrane teichoic acids and cell wall teichoic acids. Option C. Exotoxins are produced by gram positive & some Gm -ve bacteria (e.g., Shiga's dysentery bacillus. Vibrio, ETEC, Pseudomonas). Endotoxins are produced only by Gm –ve bacteria Option D. Incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A patient presented with swelling in his right foot with multiple discharging sinuses. The lesion responded to antibiotics. The likely etiological agent would be:", "options": [{"label": "A", "text": "Actinomadura or Nocardia", "correct": true}, {"label": "B", "text": "Nocardia or Exophiala", "correct": false}, {"label": "C", "text": "Sporothrix or Nocardia", "correct": false}, {"label": "D", "text": "Madurella mycetomatis or Acremonium", "correct": false}], "correct_answer": "A. Actinomadura or Nocardia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Actinomadura or Nocardia Actinomadura matures, Actinomadura Pelletier and Actinomadura dassonvillei are the species included in the genus Actinomadura. Actinomadura mature is an aerobic actinomycete that is best known worldwide as the cause of actinomycotic mycetomas.</p>\n<p><strong>Highyeild:</strong></p><p>Mycetoma Actinomycetoma occurs in tropical countries within the 'mycetoma belt' from 15 degrees south to 30 degrees north of the equator. The infection is acquired by direct inoculation via the skin. Mycetoma is a chronic, slow-growing, destructive infection, usually involving the hands or feet, and characterized by the spread of the infecting organism from its subcutaneous site of implantation to adjacent structures. Serous discharges contain small grains of organism colonies. Actinomycetoma— caused by filamentous branching bacteria. Eumycetoma (TRUE MYCETOMA)— caused by fungi. Triad: Subcutaneous swelling +Discharging sinuses+ Granules in sinuses Granules contains Silver Eumycetoma Actinomycetoma Fungus -(40%) Bacteria - (60%) Single mass with well defined margins, Serous, black in colour, Osteosclerotic Multiple, ill defined margins, osteolytic, Purulet, White/Red Black granules : Madurella MC: Nocardia >Actinomadura madurae> Streptomyces: white granules White granules: Pseudoallescheria, Aspergillus fusarium Actinomadura pelletieri :Pink to Red granules Treatment There is a role for surgery in combination with effective medical treatment, e.g. for bulk reduction. Treatment success depends on the identification of the causative organism. All cases of actinomycetoma are treated with a combination of streptomycin sulfate and a second agent determined by the causal species (e.g. dapsone for A. mature) . Eumycetoma is treated with azoles, usually itraconazole, ketoconazole, or voriconazole (preferred for P. boydii). Treatment continues in all cases fo r at least 12 months , longer with extensive bone involvement.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Nocardia, Actinomadura, and Streptomyces spp. are the common aetiological agents of actinomycetoma. But exophiala does not cause the same. Option C & D. Sporothrix and Acremonium are not associated with mycetoma.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is a characteristic of Nocardia and not of Actinomyces?", "options": [{"label": "A", "text": "Acid fastness", "correct": true}, {"label": "B", "text": "Branching morphology", "correct": false}, {"label": "C", "text": "Gram stain reaction", "correct": false}, {"label": "D", "text": "Formation of hyphae-like filaments", "correct": false}], "correct_answer": "A. Acid fastness", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acid fastness</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B and C. Actinomyces and Nocardia are Gram-positive rods characterized by filamentous, tree-like branching growth. They are opportunists that can sometimes produce indolent, slowly progressive diseases. Option D. Nocardia can usually be differentiated from Actinomyces by acid-fast staining, as Nocardia typically exhibit varying degrees of acid fastness due to the mycolic acid content of the cell wall. A cid fastness is weak/ partial and can only be appreciated with 1% H2SO4 Option D, B, and C. These are all common features of Nocardia and actinomyces.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient comes with a history of unresponsive fever and cough. On examination of sputum, it is negative for Mycobacterium. Chest x-ray shows pneumonia. BAL shows gram-positive branching filaments. The organism was partially AFB Acid-fast bacillus positive. Causative organism is?", "options": [{"label": "A", "text": "Actinomycosis", "correct": false}, {"label": "B", "text": "Nocardiosis", "correct": true}, {"label": "C", "text": "Aspergillus", "correct": false}, {"label": "D", "text": "Penicillium", "correct": false}], "correct_answer": "B. Nocardiosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nocardiosis Nocardia species are aerobic and grow on a variety of media. Microscopically nocardiae appear as filamentous, branching, hyphae-like branching. On standard laboratory media, after incubation at 35–37°C for several days, they d evelop heaped, irregular, waxy colonies. Pigmentation may be present from white to orange to red. These bacteria are Gram-positive and catalase and urease positive. Nocardiae form extensive branching substrates and aerial filaments that fragment, breaking into coccobacillus The cell walls contain mycolic acids that are shorter chained than those of Mycobacteria, causing partial acid fastness and they retain the primary dye when decolorized with 1–4% sulfuric acid instead of the stronger acid-alcohol decolorant.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. Are not acid-fast.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 53-year-old woman developed a cough productive of purulent sputum followed by slight progressive weakness of her left arm and leg. She had surgery and chemotherapy for breast cancer 3 months ago. On chest examination, rales were heard over the left upper back when breathing deeply. A neurological examination confirmed weakness in the left arm and leg. Chest x-ray showed left upper lobe infiltrate. Contrast-enhanced CT showed two lesions in the right hemisphere. The branching bacilli obtained were partially acid-fast from the sputum sample. Which of the following organism is the cause of this patient’s current illness?", "options": [{"label": "A", "text": "Actinomyces israelii", "correct": false}, {"label": "B", "text": "Aspergillus fumigatus", "correct": false}, {"label": "C", "text": "Nocardia asteroides", "correct": true}, {"label": "D", "text": "Corynebacterium pseudodiphtheriticum", "correct": false}], "correct_answer": "C. Nocardia asteroides", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689250965699-QTDV066004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nocardia asteroides Strict Aerobe Weak Acid-fast Nonmotile Environmental Saprophytes Filamentous, Beaded Clinical presentation: Cutaneous/ subcutaneous: Local abscess, cellulitis, lymph cut/subcutaneous. Actinomycotic Mycetoma Systemic: Most common- N asteroids, Pulmonary disease (pneumonia, lung abscess, other lesions resembling TB) Metastatic: Brain, Kidney & Other organs</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Actinomyces israelii is a gram-positive filamentous bacteria. Option B. Aspergillus fumigatus is a fungus with hyaline septate hyphae with acute angle branching. Option D. Corynebacterium pseudodiphtheriticum is a gram-positive bacterium.</p>\n<p><strong>Extraedge:</strong></p><p>Treatment of Nocardia: The treatment of choice is trimethoprim-sulfamethoxazole. If patients fail to respond, other antibiotics can be used, such as amikacin, imipenem, meropenem, fluoroquinolones, minocycline, linezolid, and cefotaxime. Ideally, sensitivity testing should be done.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 14 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 40-year male was admitted to the hospital with a history of loss of consciousness, emesis, headache, photophobia, and blurry vision. MRI showed a solitary 2 cm mass in the posterior left temporal lobe. A biopsy showed that the mass contained necrotizing inflammation with trophozoites, morphologically different from any of the species previously found in association with infection in humans. Although the type of organism causing the infection was not identified at the time, the patient underwent surgical excision of the tumor-like mass and received antibiotic therapy, and recovered without any neurologic sequelae. The causative agent was later identified as Sappinia diploid on the basis of distinct morphological features in hematoxylin-eosin-stained brain sections and by transmission electron microscopy images of sections from the brain lesion. Which of the following is the locomotive organ of a causative organism?", "options": [{"label": "A", "text": "Pseudopodia", "correct": true}, {"label": "B", "text": "Flagella", "correct": false}, {"label": "C", "text": "Cilia", "correct": false}, {"label": "D", "text": "No locomotive organ", "correct": false}], "correct_answer": "A. Pseudopodia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudopodia Sappinia species is a new Free-living amoeba characterized by causing Amoebic encephalitis like another free-living amoeba. They have Pseudopodia as their locomotive organs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Flagella are microscopic hair-like structures involved in the locomotion of a cell. The word “flagellum” means “whip”. The flagella have a whip-like appearance that helps to propel a cell through the liquid. Some special flagella are used in few organisms as sensory organs that can sense changes in pH and temperature. Option C. Cilia are small, slender, hair-like structures present on the surface of all mammalian cells. They are primitive in nature and could be single or many. Cilia play a major role in locomotion found on the protozoans such as paramecium and help them in locomotion Option D. Locomotive organ is required for the movement of the bacteria.</p>\n<p><strong>Extraedge:</strong></p><p>Free-living amebas are protozoa that live independently in soil or water and do not require a human or animal host. They rarely cause disease, in contrast to the parasitic ameba Entamoeba histolytica, which is a common cause of intestinal infection (amebiasis. It is acquired by fecal-oral transmission.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26 years old pregnant female, G2P1 during the 13th week of pregnancy for a routine Antenatal check-up. This was her second pregnancy and she had a history of previous cesarean delivery. Her history was negative although she reported that she was taking care of a cat recently. Sabin Fieldman dye test was positive. The patient was admitted to our center. Physical examination during admission was normal. Her initial serologic tests were: IgG 249 IU/ml (normal range 0-6 IU/ml), IgG avidity 0.010% (normal range 0-0.2%), IgM >160 IU/ml (normal range 0-10 IU/ml). Tests were repeated and additionally, IgA was measured. The new laboratory results were: IgG > 400 IU/ml, IgG avidity 4.4%, IgM 63 IU/ml, and IgA 13 IU/ml. In view of these findings, an amniocentesis was conducted at 15 weeks in order to examine whether the fetus was affected. PCR-DNA test of the amniotic fluid was negative. Although there was no evidence of vertical transmission the infection was confirmed and the patient received treatment with spiramycin 1gm three times a day (t.i.d.). In case the infection is transmitted from mother to child a characteristic triad of the disease in the newborn includes all the following?", "options": [{"label": "A", "text": "Chorioretinitis", "correct": false}, {"label": "B", "text": "Hydrocephalus", "correct": false}, {"label": "C", "text": "Intracranial calcification", "correct": false}, {"label": "D", "text": "Sensory neuronal hearing loss", "correct": true}], "correct_answer": "D. Sensory neuronal hearing loss", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sensory neuronal hearing loss Sensorineural hearing loss is not associated with a triad of congenital toxoplasmosis.</p>\n<p><strong>Highyeild:</strong></p><p>Toxoplasmosis in Pregnancy Abortion Overt disease. The symptoms vary widely, the classical triad of Congenital Toxoplasmosis is Hydrocephalus Intracranial calcification Chorioretinitis Subclinical infection: no symptoms at birth Late onset symptoms (most common in the eyes: Chorioretinitis) No symptoms at all</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. The classical triad of congenital toxoplasmosis is chorioretinitis (most common) hydrocephalus and intracranial calcifications.it does not include Sensory neural hearing loss.</p>\n<p><strong>Extraedge:</strong></p><p>Cytomegalovirus (CMV) retinitis is a viral infection of the retina of the eye resulting in inflammation. Cytomegalovirus is a large herpes-type virus commonly found in humans that can cause serious infections in people with impaired immunity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A previously healthy 23-year-old woman presented with altered sensorium with a history of severe headaches, saw “flashing lights,” and had a purulent nasal discharge for 2days. She gives a history of swimming with friends in a nearby local pond. Which of the following parasites should have been considered in the diagnosis? She had no prior history of travel outside of the India.", "options": [{"label": "A", "text": "P. falciparum", "correct": false}, {"label": "B", "text": "T. gondii", "correct": false}, {"label": "C", "text": "E. histolytica", "correct": false}, {"label": "D", "text": "Naegleria fowleri", "correct": true}], "correct_answer": "D. Naegleria fowleri", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Naegleria fowleri History of swimming, clinical features of Primary meningoencephalitis suggestive of acute amoebic meningoencephalitis caused by free-living amoebae like N. fowleri. (Habitant-fresh warm water)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Falciparum malaria causes cerebral malaria Option B. Gondii causes toxoplasmosis Option C. Entamoeba hemolytic causes amoebic dysentery.</p>\n<p><strong>Extraedge:</strong></p><p>Naegleria fowleri, colloquially known as a \"brain-eating amoeba\", is a species of the genus Naegleria, belonging to the phylum Percolozoa, which is technically not classified as a true amoeba, but a shapeshifting amoeboflagellate excavate.[1] It is a free-living, bacteria-eating microorganism that can be pathogenic, causing an extremely rare, sudden, severe, and usually fatal brain infection called naegleriasis or primary amoebic meningoencephalitis (PAM).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26 years female presented with redness of eyes; foreign body sensation & corneal ulcer followed by usage of contact lenses. Saline mount scrapings of the cornea revealed cysts with polyhedral inner walls & irregular outer wall morphology. Which of the following is most likely the causative organism", "options": [{"label": "A", "text": "Acanthamoeba", "correct": true}, {"label": "B", "text": "Entamoeba histolyticum", "correct": false}, {"label": "C", "text": "Naegleria fowleri", "correct": false}, {"label": "D", "text": "Giardia lamblia", "correct": false}], "correct_answer": "A. Acanthamoeba", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687505013673-QTDV013006IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acanthamoeba History of usage of contact lenses with keratitis and description of organism suggestive of acanthamoeba keratitis caused by acanthamoeba. Ring ulcers of the cornea are characteristic & usually associated with contact lens users.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Entamoeba histolytic causes amoebic dysentery. Option C. Naegleria fowleri causes primary amoebic meningoencephalitis. Option D. Giardia lamblia causes diarrhea</p>\n<p><strong>Extraedge:</strong></p><p>Bacterial keratitis can advance through four stages: progressive infiltration, active ulceration, regression, and healing.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 20-year-old man visiting Europe dives into a secluded natural pool. He later develops meningoencephalitis localized to the base of his brain. The causative organism is found to be the free-living amoeba, Naegleria fowleri. Which of the following structures did he probably damage during the dive?", "options": [{"label": "A", "text": "Cribriform plate", "correct": true}, {"label": "B", "text": "Lacrimal bone", "correct": false}, {"label": "C", "text": "Mandible", "correct": false}, {"label": "D", "text": "Nasal bone", "correct": false}], "correct_answer": "A. Cribriform plate", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cribriform plate Naegleria fowleri , colloquially known as th e \"brain-eating amoeba \", is a species of the genus Naegleria, belonging to the phylum Percolozoa, which is technically not classified as true amoeba, but a shape-shifting ameboflagellate excavate.</p>\n<p><strong>Highyeild:</strong></p><p>Infections most often occur when water containing N. fowleri is inhaled through the nose, where it then enters the nasal and olfactory nerve tissue, traveling to the brain through the cribriform plate (option A). Fowleri normally eats bacteria, but during human infections, the trophozoites consume astrocytes and neurons.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B, C & D. Fowleri infections occurs when it travels to the brain through the cribriform plate hence they are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Eosinophilic meningitis is caused by:", "options": [{"label": "A", "text": "Gnathostoma spiral", "correct": false}, {"label": "B", "text": "Naegleria", "correct": false}, {"label": "C", "text": "Toxocara canis", "correct": false}, {"label": "D", "text": "Angiostrongylus cantonensis", "correct": true}], "correct_answer": "D. Angiostrongylus cantonensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Angiostrongylus cantonensis Angiostrongylus cantonensis is a parasitic nematode that causes angiostrongyliasis, the most common cause of eosinophilic meningitis i n Southeast Asia and the Pacific Basin. The nematode commonly resides in the pulmonary arteries of rats, giving it the common name rat lungworm.</p>\n<p><strong>Highyeild:</strong></p><p>Angiostrongylus is a parasitic nematode that can cause severe gastrointestinal or central nervous system disease in humans, depending on the species. Angiostrongylus cantonensis, which is also known as the rat lungworm, causes eosinophilic meningitis and is prevalent in Southeast Asia and tropical Pacific islands. Angiostrongylus Eosinophilic Meningitis is caused by human infection with larvae of the rat lungworm, Angiostrongylus cantonensis. The clinical presentation includes a spectrum of diseases, from meningitis through radiculitis, cranial nerve abnormalities, ataxia, encephalitis, coma, and rarely death.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Gnathostoma spiral-Nematode. Cause Ganathostomiasis. Option B. Naegleria- cause Primary Amebic Encephalitis. Option C. Toxocara canis- cause Toxoplasmosis.</p>\n<p><strong>Extraedge:</strong></p><p>The initial sign of acute strongyloidiasis, if noticed at all, is a localized pruritic, erythematous rash at the site of skin penetration. Patients may then develop tracheal irritation and a dry cough as the larvae migrate from the lungs up through the trachea.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cerebral malaria most commonly attends infection with which of the following?", "options": [{"label": "A", "text": "Plasmodium vivax", "correct": false}, {"label": "B", "text": "Plasmodium malariae", "correct": false}, {"label": "C", "text": "Plasmodium falciparum", "correct": true}, {"label": "D", "text": "Plasmodium ovale", "correct": false}], "correct_answer": "C. Plasmodium falciparum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Plasmodium falciparum Cerebral malaria is the most sever e neurological complication of infection with Plasmodium falciparum malaria. It is a clinical syndrome characterized by coma and asexual forms of the parasite on peripheral blood smears .</p>\n<p><strong>Highyeild:</strong></p><p>In most cases, malaria deaths are related to one or more serious complications, including Cerebral malaria. If parasite-filled blood cells block small blood vessels in your brain (cerebral malaria), swelling of your brain or brain damage may occur. Cerebral malaria may cause seizures and coma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & D. Vivax, P. malariae, and P Ovale invade either old or young red blood cells but not both. It causes relatively low-grade and less severe parasitemia as compared to P. Falciparum and do not commonly lead to severe and frequently fatal complications such as cerebral malaria, algid malaria, malaria hyperpyrexia, and blackwater fever.</p>\n<p><strong>Extraedge:</strong></p><p>The significant complications of malaria are cerebral malaria, severe malarial anemia, and nephrotic syndrome (NS). Additional complications include: Bilious remittent fever presents with abdominal pain and persistent vomiting that may lead to severe dehydration, jaundice, and dark urine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 36-year-old man with AIDS develops right-sided weakness involving the lower, but not the upper, limb. MRI Magnetic Resonance Imaging scans reveal a ring-enhancing lesion within the white matter of the left frontal lobe. A biopsy shows coagulative necrosis of brain parenchyma with macrophage-rich chronic inflammatory infiltration admixed with microscopic cysts that contain characteristic bradyzoites. Which is the most common source of this type of infection?", "options": [{"label": "A", "text": "Anopheles mosquitoes", "correct": false}, {"label": "B", "text": "Bird droppings", "correct": false}, {"label": "C", "text": "Cats", "correct": true}, {"label": "D", "text": "Cooling systems", "correct": false}], "correct_answer": "C. Cats", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cats Diagnosis- Toxoplasmosis MC Source- Cats Poor lower-limb strength is common in patients with long-term HIV infection.</p>\n<p><strong>Highyeild:</strong></p><p>Multiple ring‐enhancing lesions in HIV-positive patients are seen at advanced stages of immunosuppression. Differential diagnosis primarily includes tuberculoma, primary CNS lymphoma, and toxoplasmosis. Sometimes, it may be due to bacterial or fungal abscesses. Ring-enhancing lesions in the brain can also be seen in primary CNS lymphoma which often causes diagnostic confusion. A ring-enhancing brain lesion in AIDS patients has a broad differential diagnosis— cerebral toxoplasmosis, primary central nervous system (CNS) lymphoma. In the brain, it can occur with an early brain abscess as well as in Nocardia infections associated with lung cavitary lesions.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. Are not the source of Toxoplasmosis.</p>\n<p><strong>Extraedge:</strong></p><p>Toxoplasmosis Multiple or solitary(14%) areas of abnormal low attenuation Regions affected - Basal ganglia, Thalamus, Brainstem No subarachnoid spread Surrounding yasogenic edema and mass effect Calcification (after treatment)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Neurocysticercosis, the following are true except:", "options": [{"label": "A", "text": "Not acquired by eating contaminated vegetables", "correct": true}, {"label": "B", "text": "Caused by reverse peristalsis leading to the internal development of egg", "correct": false}, {"label": "C", "text": "Acquired by oro-fecal route", "correct": false}, {"label": "D", "text": "Acquired by autoinfection", "correct": false}], "correct_answer": "A. Not acquired by eating contaminated vegetables", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Not acquired by eating contaminated vegetables It is acquired by eating contaminated vegetables containing the eggs of the parasite. or a person harboring adult worms may autoinfect himself or reverse peristalsis may throw gravid segments back into the stomach.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B & D. A person harboring adult worms may autoinfect himself or reverse peristalsis may throw gravid segments back into the stomach. Option C. infection can be acquired by oro-fecal route via contaminated vegetables containing the eggs of the parasite</p>\n<p><strong>Extraedge:</strong></p><p>Neurocysticercosis is a preventable parasitic infection caused by larval cysts (enclosed sacs containing the immature stage of a parasite) of the pork tapeworm (Taenia solium). The larval cysts can infect various parts of the body causing a condition known as cysticercosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Encephalitis is caused by which parasite:", "options": [{"label": "A", "text": "Acanthamoeba", "correct": true}, {"label": "B", "text": "Entamoeba histolytica", "correct": false}, {"label": "C", "text": "Echinococcus", "correct": false}, {"label": "D", "text": "Escherichia coli", "correct": false}], "correct_answer": "A. Acanthamoeba", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acanthamoeba Granulomatous amoebic encephalitis (GAE) is caused by a free-living amoeba, Acanthamoeba spp. The disease occurs in debilitated/ immunosuppressed Mode of infection is the inhalation of a cyst or trophozoite in an infected aerosol followed by dissemination to the blood from the lungs.</p>\n<p><strong>Highyeild:</strong></p><p>Prolonged chronic course unlike Primary amoebic meningitis caused by Naegleria fowler .Diagnosis often requires a brain biopsy as CSF may be negative for trophozoites or cysts. Another species is Balamuthia mandrillaris.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Entamoeba histolytica is an anaerobic parasitic protozoa. It infects humans and other primates causing amoebiasis Option C. Echinococcus is a small, three-segmented tapeworm found only in the intestine of dogs and other canids. The larva develops in hydatid The liver is the most common site where compression, atrophy, portal hypertension from mechanical obstruction, and cirrhosis can occur Option D. coli is the most common cause of urinary tract infections and it also causes diarrhea, sepsis, and meningitis.</p>\n<p><strong>Extraedge:</strong></p><p>Amebic encephalitis is a rare but lethal central nervous system infection caused by free-living amoebae found in freshwater, lakes, and rivers. There are two types of amebic encephalitis, namely primary meningoencephalitis (PAM) and granulomatous amebic encephalitis (GAE).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Acute primary amoebic meningoencephalitis, true is:", "options": [{"label": "A", "text": "Meningitis caused by Acanthamoeba sp. Is acute in nature", "correct": false}, {"label": "B", "text": "Diagnosed by trophozoite in CSF", "correct": true}, {"label": "C", "text": "Caused by fecal-oral transmission", "correct": false}, {"label": "D", "text": "CNS infection was seen in immunocompromised persons", "correct": false}], "correct_answer": "B. Diagnosed by trophozoite in CSF", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diagnosed by trophozoite in CSF Motile trophozoites can be demonstrated in wet mount preparation of CSF .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A & D. Primary Amoebic Meningoencephalitis is caused by a free-living amoeba, Naeglaria fowleri in healthy young adults. Option C. Infection is acquired by nasal contamination during swimming in fresh hot water bodies like ponds, river, swimming pools, or lakes.</p>\n<p><strong>Extraedge:</strong></p><p>symptoms of primary amoebic encephalitis The following symptoms usually develop within three to seven days of infection: high fever. severe and persistent headache. neck stiffness. confusion, hallucinations. Sleepiness sore throat. nausea and vomiting. disturbances of taste and smell.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 44 year old IV drug abuser was taken to the hospital in a state of high grade fever and drowsiness. The clinician suspected it to be CNS infection and ordered a CSF analysis. The opening pressure was raised and no organisms were seen on routine stain. Considering his immunocompromised status, he ordered a special stain and results came out were positive. Choose the incorrect statement.", "options": [{"label": "A", "text": "This is a urease negative, phenol oxidase positive yeast like fungus.", "correct": true}, {"label": "B", "text": "India Ink stain is use to stain the organism.", "correct": false}, {"label": "C", "text": "Eucalyptus trees are the reservoir for one the varieties of pathogen.", "correct": false}, {"label": "D", "text": "Bird seed agar and Niger seed agar is used for the culture of microbe.", "correct": false}], "correct_answer": "A. This is a urease negative, phenol oxidase positive yeast like fungus.", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687505018418-QTDV013016IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>This is a urease negative, phenol oxidase positive yeast like fungus. Cryptococcus species are urease positive, phenoloxidase positive, true yeasts and causes infection in immunodeficiency and immune compromised patients. (IV drug abuser’s, MSM, sex workers etc).</p>\n<p><strong>Highyeild:</strong></p><p>Cryptococcal meningitis is a fungal infection caused by Cryptococcus neoformans, which is often found in bird droppings. If breathed in, the spores can multiply and spread from the lungs to the membranes that cover the brain or spinal cord, causing meningitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. It is capsulated organism and capsule shows Maltese cross appearance on polarising microscope. Option C. For var gatti - Eucalyptus trees are reservoir, and for var grubii, pegeion feces are reservoir. Option D. Bird seed agar and Niger seed agar is used for the culture of microbe and it shows black colonies on them.</p>\n<p><strong>Extraedge:</strong></p><p>Drugs used to treat cryptococcal meningitis Only three antifungal drugs have reliable efficacy in vivo: intravenous amphotericin B, oral flucytosine and oral fluconazole.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 22 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 61-year-old man presented with progressive dyspnea, abdominal pain, and cough for the past week. His medical history was remarkable for asthma since childhood; he was treated with beta-agonists, ipratropium, and orally administered corticosteroids. On evaluation, he was febrile and ill-appearing. His chest examination revealed diffuse wheezing and bilateral crackles. He was diagnosed as having community-acquired pneumonia and asthma exacerbation and was started on empiric antibiotics, nebulized beta-agonists, and orally administered corticosteroids. His clinical status continued deteriorating and he became critically ill despite broad-spectrum antibiotics and antifungals. Considering the epidemiological background of our patient, bronchoalveolar and faecal samples were obtained to investigate soil-transmitted helminths. Rhabditiform larvae of Ovoviviparous helminths were found in both specimens. All the following statements are true regarding the causative organism except?", "options": [{"label": "A", "text": "The organism produces a cutaneous eruption at the point of entry known as Larva currens", "correct": false}, {"label": "B", "text": "The causative organism is not associated with autoinfection", "correct": true}, {"label": "C", "text": "Patients can present with Loeffler’s pulmonary eosinophilia", "correct": false}, {"label": "D", "text": "Skin penetration of the Larva is a route of entry for the organism", "correct": false}], "correct_answer": "B. The causative organism is not associated with autoinfection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The causative organism is not associated with autoinfection The clinical picture under stool examination findings is suggestive of infection of Strongyloides stercoralis. It is a pathogenic worm which is a small intestine inhabitant. It can cause autoinfection. It produces physical cutaneous eruption at the point of entry known as Larva currens</p>\n<p><strong>Highyeild:</strong></p><p>Larva Currens Strongyloides can produce internal reinfection or autoinfection if newly hatched larvae never exit the host but, instead, undergo mo u lting within the intestine. These larvae penetrate the intestine, migrate throughout the circulatory system, enter the lungs and heart (similar to the migration of hookworms upon penetrating skin), and develop into parasitic females in the intestine. These nematodes are able to sustain an infection for many years and, if immunosuppressed, produce hyperinflation which is fulminating and fatal . Disseminated infections are mainly involved in the gastrointestinal tract (severe diarrhoea, abdominal pain, gastrointestinal bleeding, nausea, vomiting), lungs (coughing, wheezing, hemoptysis), and s kin (rash, pruritus, larva currens). Larvae migrating from the intestine carrying enteric bacteria can cause local infections or sepsis, resulting in death.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C and D. Are correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 31-year-old man from Northern India who has worked in Singapore for the past 8 years, presented with wheezing and intermittent shortness of breath, and early morning cough for 6 months. He was initially given a presumptive diagnosis of asthma and treated with inhalers together with a short course of prednisolone and antibiotics, to no avail for the past 8 months. He had no significant past medical history. There were also no hemoptysis, fever and weight loss, or exposure to tuberculosis (TB) contacts. He did not smoke or drink alcohol, nor was he on any long-term medications. The respiratory exam revealed bilateral crepitations and expiratory rhonchi. There was no lymphadenopathy. Investigations demonstrated leukocytosis 28,500/µL with marked eosinophilia 21,500/µL. Chest radiography demonstrated tiny clustered nodular opacities in both lungs. CT scan of the thorax showed diffuse tiny scattered pulmonary nodularity with peripheral ground glass opacities and areas of scarring. He also had a raised serum Ig E of 15,000 international units (IU)/mL. Bronchoalveolar lavage cultures were negative. Other tests such as stool tests for ova, cysts and parasites, were negative. Filariasis IgG serology was positive. Diagnosis?", "options": [{"label": "A", "text": "Chronic lymphatic filariasis", "correct": false}, {"label": "B", "text": "Mayer kouwenaar syndrome", "correct": false}, {"label": "C", "text": "Tubercular lymphadenitis", "correct": false}, {"label": "D", "text": "Weingarten syndrome", "correct": true}], "correct_answer": "D. Weingarten syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Weingarten syndrome Intermittent shortness of breath, chronic cough with Chest radiography showing tiny clustered nodular opacities in both lungs with marked peripheral eosinophilia and serology positive for filariasis suggestive of tropical pulmonary eosinophilia also known as Weingarten syndrome. → it occurs due to infiltration of microfilaria in the lungs. Weingarten first described the term tropical pulmonary eosinophilia (TPE) in 1943. It was previously described as “pseudotuberculosis with eosinophilia.” The onset of tropical pulmonary eosinophilia is slow, and the major symptoms are fever, nocturnal cough, dyspnea, and wheezing.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It’s not chronic lymphatic filariasis because there are no signs of lymphatic obstruction mentioned in the question. Option B. Mayer Kouwenaar syndrome is occult filariasis will not have prominent lung findings which are mentioned in the question. Option C. No fever, weight loss or history of contact with TB Patients and no lymphadenopathy rule out TB lymphadenitis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25 years pregnant woman had been admitted to an outpatient clinic on the 15th week of her pregnancy on account of a febrile illness, headache, enlargement of lymph nodes, and symptoms of the common cold. The patient was given a one-week course of antibiotics but remained symptomatic. At the second admission to an ear, nose, and throat (ENT) specialist, Toxoplasma serological tests, both IgG and IgM, were requested for the patient. Both tests were found to be strongly positive. Serum samples were sent to a reference laboratory one week later and the results were further confirmed. C-reactive protein (CRP) and mono tests were both negative. Elevated erythrocyte sedimentation rate (ESR) was noticed in her haematology tests. The rest of the biochemistry and haematological indices were normal. Which of the following is true regarding the causative organism of the patient's condition except?", "options": [{"label": "A", "text": "Low Avidity of IgG Avidity test is associated with Chronic Infection", "correct": true}, {"label": "B", "text": "Sabin Fieldman test is the gold standard test for the diagnosis of a patient’s condition", "correct": false}, {"label": "C", "text": "Tissue specimen reveals slowly dividing forms known as Bradyzoites", "correct": false}, {"label": "D", "text": "Tachyzoites are rapidly dividing forms seen in Peripheral Blood smears.", "correct": false}], "correct_answer": "A. Low Avidity of IgG Avidity test is associated with Chronic Infection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Low Avidity of IgG Avidity test is associated with Chronic Infection The timely diagnosis of congenital infections is particularly important for the appropriate management of the fetus. Affinity is the strength required for an interaction between a site of antigen binding at an antibody and an antigen epitope. Avidity is the total strength required for the interaction between a multivalent antibody and multiple antigenic epitopes. As the antibodies mature the avidity increases, indicating chronic infection. Remember: High Avidity of IgG Avidity test is associated with Chronic Infection Low Avidity of IgG Avidity test is associated with acute Infection</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Sabin Fieldman test is the gold standard test for diagnosis of Toxoplasmosis Options C and D. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ascaris lumbricoides is the \"large roundworm\" of humans, growing to a length of up to 35 cm. A definitive diagnosis of ascariasis can be made by?", "options": [{"label": "A", "text": "An eosinophilia in a differential white blood cell count.", "correct": false}, {"label": "B", "text": "Motile larvae in a stool sample.", "correct": false}, {"label": "C", "text": "Larvae in the X-ray of lungs.", "correct": false}, {"label": "D", "text": "An adult worm passed during a bowel movement.", "correct": true}], "correct_answer": "D. An adult worm passed during a bowel movement.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>An adult worm passed during a bowel movement. Most commonly the eggs of Ascaris are passed in faeces, however, sometimes adult worms may pass too.</p>\n<p><strong>Highyeild:</strong></p><p>Ascaris Adult Worm Life Cycle Of Ascaris:</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Eosinophilia is associated with many parasites not a definitive diagnosis aspect of any parasite. Option B. Option larvae in stool is a diagnostic feature of Strongyloides stercoralis. Option C. larvae in X-Ray are not visualized.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cavitary lesion in the right lower lung with dyspnea following microscopic appearance. most likely diagnosis is?", "options": [{"label": "A", "text": "Echinococcus with 2 layers", "correct": false}, {"label": "B", "text": "Strongyloides with 2 layers", "correct": false}, {"label": "C", "text": "Paragonimus with 2 layers", "correct": true}, {"label": "D", "text": "Cysticercosis with 3 layers", "correct": false}], "correct_answer": "C. Paragonimus with 2 layers", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689248356603-QTDV055007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Paragonimus with 2 layers Paragonimus westermani is the major species of lung fluke that infects humans. It is a food-borne parasitic infection. It infects an estimated 22 million people yearly worldwide. It is particularly common in East Asia. It is the most common parasitic lung infection with the definitive diagnosis of the eggs in sputum. Paragonimus westermani eggs range from 80-120 µm long by 45-70 µm wide. They are yellow-brown, ovoid or elongated, with a thick shell, and often asymmetrical with one end slightly flattened. At the large end, the operculum is clearly visible . The opposite (abopercular) end is thickened.</p>\n<p><strong>Highyeild:</strong></p><p>life cycle of P. westermani:</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & D. Are incorrect. Option D. Cysticercosis is an infection caused by taenia spp.</p>\n<p><strong>Extraedge:</strong></p><p>Parasitic Lung Infections: Microscopic examination of sputum is used in identifying Paragonimus westermani eggs, Strongyloides stercoralis larvae, Ascaris lumbricoides larvae, hookworm larvae, and rarely Entamoeba histolytica.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Katayama fever has typical features including fever, an urticarial rash, enlarged liver and spleen, and bronchospasm. Katayama fever is caused by-", "options": [{"label": "A", "text": "Schistosoma Japonicum", "correct": true}, {"label": "B", "text": "Clonorchis sinensis", "correct": false}, {"label": "C", "text": "Fasciola hepatica", "correct": false}, {"label": "D", "text": "Fasciola gigantica", "correct": false}], "correct_answer": "A. Schistosoma Japonicum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Schistosoma Japonicum Acute schistosomiasis or Katayama fever occurs about a month after infection with S. japonicum and S. mansoni and rarely with S. haematobium. This corresponds to the first oviposition by the mature female worms. High fever, hepatomegaly, splenomegaly, lymphadenopathy, eosinophilia and dysentery are seen.</p>\n<p><strong>Highyeild:</strong></p><p>Different Types of Schistosoma Eggs: Important to note the position of the spine, the sample of interest and the geographical area. Type of fluke Disease Species Blood Schistosomiasis Schistosoma haematobium Schistosoma japonicum Schistosoma mansoni Schistosoma mekongi Schistosoma intercalatum Liver Clonorchiasis Opisthorchiasis Fascioliasis Clonorchis sinensis Opisthorcis felineus Opisthorcis viverrini Fasciola hepatica Intestinal Fasciolopsiasis Heterophyiasis Fasciolopsis buski Heterophyes heterophyes Lung Paragonimiasis Paragonimus westermani</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old boy presents to the emergency department with high-grade fever and altered sensorium. The parents gave the history of CSF rhinorrhea and swimming in the local village pond. The clinician suspected a rare parasitic infection after ruling out the common causes. Choose the incorrect statement regarding the parasite:", "options": [{"label": "A", "text": "Is a free-living parasite", "correct": false}, {"label": "B", "text": "Treatment is amphotericin B.", "correct": false}, {"label": "C", "text": "Both cysts and trophozoites can be seen in CSF.", "correct": true}, {"label": "D", "text": "Causes primary amoebic meningoencephalitis.", "correct": false}], "correct_answer": "C. Both cysts and trophozoites can be seen in CSF.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both cysts and trophozoites can be seen in CSF. This is an incorrect statement, as only trophozoites can be demonstrated in CSF analysis. (The parasites have both cyst and trophozoites form, and only trophozoites are infective form).</p>\n<p><strong>Highyeild:</strong></p><p>Differentiation of free-living amoeba S No Salient Features Acanthamoeba Balamuthia Naegleria 1 Growth medium It can be grown on non- nutrient agar plate coated with bacteria, mammalian cell cultures and axenic medium. Echo-virus, mimivirus, adenovirus, coxsackie etc. It can be grown on non- nutrient agar plate coated with bacteria, tissue culture cells, cell free axenic medium, chemically defined medium 2 Culturing temperature 30 o C or above 37 °C 45 °C 3 Life stages Two stages: cyst and trophozoites Two stages: cyst and trophozoites Three stages: cyst, trophozoites and flagellate stage 4 Food in natural environment Bacteria Mainly bacteria but to some extent Acanthamoeba Bacteria and organic matter 5 Environmental isolation sources Variety of soil, air, water sources i.e, bottled mineral water, cooling towers, air conditioning units, dialysis machines, bacterial, fungal and mammalian cell cultures etc. Soil and dust Swimming pools, ponds, hot springs, thermally polluted streams, rivers and various types of soil etc 6 Clinical Isolation source Brain, lung, skin, cornea Brain Nasal mucosa, nasal passages, brain tissue 7 Reported infections Ganulomatous amoebic encephalitis, Amoebic keratitis, Cutaneous acanthamoebiasis Balamuthia amoebic encephalitis, Skin ulceration Primary amoebic meningoencephalitis 8 Species identified so far More than 24 species Single specie: Balamuthia mandrillaris 30 species 9 Reservoir for pathogenic microorganisms Echo-virus, mimivirus, adenovirus, coxsackie etc. Legionella, Simkania negevensis etc. Legionella pneumophila</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Naegleria fowleri is a free-living amoeba (village pond was hinted at) causing meningitis through d irect entry into CNS via cribriform plate . (CSF rhinorrhea was the hint in the question). Any history of sudden onset encephalitis with extreme prostration after a swim in the lake or freshwater exposure is associated with free-living amoeba (Option A) Option B. Amphotericin along with rifampicin and macrolide is used. It's an infection with high fatality. Only a handful of survivors have been reported. Option D. N. fowleri is a cause of PAE ( Primary amoebic encephalitis)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 17 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 10 years old male child is brought to OPD with complaints of perianal itching which has been disturbing the child during clinical examination and reveals scaly skin in the perianal region. The physician instructed the parents to place transparent tape on the peri-anal region the next morning and then returned to the hospital. The next day the tape is transferred to a microscope slide and a low-power examination of the slide reveals the following finding. Which of the following is a causative organism of the patient's condition?", "options": [{"label": "A", "text": "Wuchereria bancrofti", "correct": false}, {"label": "B", "text": "Ascaris lumbricoides", "correct": false}, {"label": "C", "text": "Trichuris trichura", "correct": false}, {"label": "D", "text": "Enterobius vermicularis", "correct": true}], "correct_answer": "D. Enterobius vermicularis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251055031-QTDV067001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterobius vermicularis The egg picture is consistent with Enterobius, these are plano-convex eggs that are nonbile stained. Perianal scales and itching especially during night times occur due to pinworm. question explaining the NIH swab or cellophane tape technique that is used for diagnosing pinworm eggs(Enterobius vermicular’s). Pinworm is an intestinal nematode lives in large intestine and may cause appendicitis and perianal pruritis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. bancrofti is a non-intestinal nematode that does not cause intestinal obstruction. Option B. Ascaris lumbricoides is an intestinal nematode (small intestine) also known as roundworm causes mechanical obstruction symptoms. Option C. Trichuris Trichiura causes rectal prolapse and chronic dysentery leading to iron deficiency anemia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 21yr old male presented with swelling in the left axilla for 15 days, and fever with cough for 1 month. On examination, a single, firm, axillary swelling was observed, measuring 4cm x 3cm x 1.8cm. No other lymph nodes were enlarged. A clinical diagnosis of tubercular lymphadenitis was entertained. FNAC was advised. Multiple aspirations from representative lesions were obtained using a 22G disposable needle and 10 ml disposable syringes. 2 ml of whitish fluid aspirated, Fixed, and air-dried smears were stained by Hematoxylin & Eosin. Smears were hypercellular, consisting of a mixed inflammatory infiltrate comprising neutrophils, eosinophils, and macrophages seen against a lymphocytic background. Multiple fragments of the adult filarial worm as well as microfilariae of Wuchereria bancrofti were seen in the smears. Examination revealed Peripheral eosinophilia (9%) was noted. No microfilariae were seen in the peripheral smears of both the patients (both thick and thin smears examined). Which of the following is the diagnosis of the patient’s condition?", "options": [{"label": "A", "text": "Chronic lymphatic filariasis", "correct": false}, {"label": "B", "text": "Mayer-kouwenaar syndrome", "correct": true}, {"label": "C", "text": "Tubercular lymphadenitis", "correct": false}, {"label": "D", "text": "Tropical pulmonary eosinophilia", "correct": false}], "correct_answer": "B. Mayer-kouwenaar syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mayer-kouwenaar syndrome The absence of microfilaria in the peripheral smear and the presence of microfilaria in the tissue biopsy is diagnostic of occult filariasis also known as Mayer-kouwenaur syndrome. It occurs due to allergic reaction microfilaria which is destructed in visceral organs.</p>\n<p><strong>Highyeild:</strong></p><p>The Various Life Cycles Of Parasites Parasites having direct life cycle Protozoa Helminths ● Giardia lamblia ● Trichomonas vaginalis ● Balantidium coli ● Ascaris lumbricoides ● Trichuris trichiura ● Ancyclostoma duodenale Parasites having indirect life cycle S.No Protozoa Definite host Intermediate host 1 Plasmodium spp Female Anopheles mosquito Man 2 Toxoplasma gondii Cat Man 3 Cestodes Taenia solium Man Pig 4 Trematodes Fasciola hepatica Man Snail 5 Nematodes Wuchereria bancrofti Man Mosquito</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. it’s not chronic lymphatic filariasis because there are no signs of lymphatic obstruction mentioned in the question. Option C. Smear showing adult filarial worm and prominent peripheral eosinophilia rules out tubercular lymphadenitis Option D. It’s not tropical pulmonary eosinophilia as there are no prominent lung-related findings mentioned in the question.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The infective form is metacercaria larvae in all the following except: Schistosoma haematobium Fasciola hepatica Paragonimus westermani Clonorchis sinensis Select the answer from the given below code:", "options": [{"label": "A", "text": "1, 2 and 3", "correct": false}, {"label": "B", "text": "2, 3 and 4", "correct": false}, {"label": "C", "text": "Only 1", "correct": true}, {"label": "D", "text": "1 and 4", "correct": false}], "correct_answer": "C. Only 1", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Only 1 All the trematodes have metacercaria as its infective form. Except, Schistosoma species, which has Cercariae larvae as its infective form Trematodes like facial hepatica, paragonimus westermani, Clonorchis sinensis have metacercaria larva as its infective form.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following are true regarding clinical manifestations caused by various parasites? Clonorchis sinensis-Hepatocellular carcinoma Schistosoma haematobium-squamous cell carcinoma of the bladder Diphyllobothrium -megaloblastic anemia Trichuris trichiura-rectal prolapse Select the correct option from the given below code:", "options": [{"label": "A", "text": "1 and 2 are correct", "correct": false}, {"label": "B", "text": "1 2 and 3 are correct", "correct": false}, {"label": "C", "text": "Only 2 are correct", "correct": false}, {"label": "D", "text": "All the above are correct", "correct": true}], "correct_answer": "D. All the above are correct", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All the above are correct Clonorchis sinensis is an inhabitant of the bile duct a nd is associated with Hepatocellular carcinoma Schistosoma haematobium parasitizes at vesicular plexus and is associated with squamous cell carcinoma of the bladder Diphyllobothrium or fish tapeworm is a duodenum inhabitant and is associated with malabsorption of Vitamin B12 resulting in megaloblastic anemia. Trichuris trichiura or pin-worm is associated with rectal prolapse in children.</p>\n<p><strong>Random:</strong></p><p>Explanation for othe options:- All the above statements are correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The following organism is an intermediate host for all the organisms below except:", "options": [{"label": "A", "text": "Shistosomiasis", "correct": false}, {"label": "B", "text": "Paragonus westermani", "correct": false}, {"label": "C", "text": "Fasciola hepatica", "correct": false}, {"label": "D", "text": "Echinococcus granulosus", "correct": true}], "correct_answer": "D. Echinococcus granulosus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251057126-QTDV067005IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Echinococcus granulosus The given image is of a snail. Echinococcus granulosus is a cestode with humans as the intermediate hosts & Dogs as the definitive host. Schistosoma, Paragonus westermani & Fasciola hepatica are flukes(trematodes) that have snails as intermediate hosts.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In people with the mucocutaneous form of the disease, symptoms usually appear one to five years after the skin lesions. These are primarily ulcers in their mouth and nose or on their lips. Mucocutaneous leishmaniasis is caused by :", "options": [{"label": "A", "text": "L-braziliensis", "correct": true}, {"label": "B", "text": "L. Tropica", "correct": false}, {"label": "C", "text": "L-donovani", "correct": false}, {"label": "D", "text": "L. Orientalis", "correct": false}], "correct_answer": "A. L-braziliensis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>L-braziliensis Leishmania braziliensis, the protozoan that causes mucocutaneous leishmaniasis, is transmitted by sand flies of the genus Lutzomyia. Essential to the development of these sand flies is an environment of low light intensity, high humidity, and organic debris upon which the larvae feed.</p>\n<p><strong>Highyeild:</strong></p><p>Leishmaniasis is caused by various Leishmania spp. that vary in geographical distribution and clinical features. There are three clinical syndromes: Visceral leishmaniasis (kala-azar); Cutaneous leishmaniasis; Mucosal leishmaniasis (espundia); Post-kala- azar dermal leishmaniasis. Visceral leishmaniasis : Leishmania Donovani spp. (India, Pakistan, Nepal, East Africa, Eastern China), Leishmania infantum (Middle East, Mediterranean, Balkans, Central and South West Asia, North and West China, North, and sub-Saharan Africa), or Leishmania chagasi (Latin America). Cutaneous leishmaniasis : The classic form of Old World cutaneous leishmaniasis , the oriental sore , Found in the Middle East, the Mediterranean, Africa, India, and Asia. Caused by L. major, L. tropica, Leishmania aethiopica New World cutaneous leishmaniasis is endemic in Latin America. It is caused by Leishmania brazilensis, Leishmania mexicana, Leishmania panamensis Mucosal leishmaniasis (pundit) mainly occurs in Latin America and is usually caused by L. braziliensis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Mucocutaneous is an infection caused by a single-celled parasite transmitted by sand fly bites. There are about 20 species of Leishmania that may cause mucocutaneous leishmaniasis. Option C. Some Leishmania species are closely linked to humans and are therefore found in cities L. Braziliensis. A rare form of the disease, mucocutaneous leishmaniasis is caused by the cutaneous form of the parasite and can occur several months after skin ulcers heal. Options B, C, and D . Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old captain in the army has been plagued by a painful, erosive lesion on his nose since his return from operation desert storm several years ago. Punch biopsy of the leading edge of the erosion reveals macrophages distended with oval amastigotes. How was this infection acquired?", "options": [{"label": "A", "text": "Contact with contaminated drinking water", "correct": false}, {"label": "B", "text": "Bite of the infected anopheles mosquito", "correct": false}, {"label": "C", "text": "Bite of infected reduviid bug", "correct": false}, {"label": "D", "text": "Bite of sandfly", "correct": true}], "correct_answer": "D. Bite of sandfly", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bite of sandfly Leishmaniasis is caused by a protozoa parasite from over 20 Leishmania species. Over 90 sandfly species are known to transmit Leishmania parasites. There are 3 main forms of the disease: Visceral leishmaniasis (VL), also known as kala-azar is fatal if left untreated in over 95% of cases. It is a skin infection caused by a single-celled parasite that is transmitted by the bite of a phlebotomine sandfly. Leishmaniasis is diagnosed by detecting Leishmania parasites (or DNA) in tissue specimens—such as from skin lesions, for cutaneous leishmaniasis (see instructions), or from bone marrow, for visceral leishmaniasis)—via light-microscopic examination of stained slides, molecular methods, and specialized methods.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Contaminated water and poor sanitation are linked to the transmission of diseases such as cholera, diarrhea, dysentery, hepatitis A, typhoid, and polio. Absent, inadequate, or inappropriately managed water and sanitation services expose individuals to preventable health risks Option B. The malaria parasite life cycle involves two hosts. During a blood meal, a malaria-infected female Anopheles mosquito inoculates sporozoites into the human Sporozoites infect liver cells and mature into schizonts, which rupture and release merozoites. Option C. Chagas disease is an inflammatory, infectious disease caused by the parasite Trypanosoma cruzi. This parasite is found in the feces of the triatomine (reduviid) bug. Options B, C, and A. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Diurnal periodicity is seen in-", "options": [{"label": "A", "text": "Wuchereria bancrofti", "correct": false}, {"label": "B", "text": "Brugia malayi", "correct": false}, {"label": "C", "text": "Loa loa", "correct": true}, {"label": "D", "text": "Mansonella perstans", "correct": false}], "correct_answer": "C. Loa loa", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Loa loa Loa is the filarial nematode species that causes Loa loa filariasis. Loa means \"worm worm\", but is commonly known as the \" eye worm\", as it localizes to the conjunctiva of the eye. These parasites have a diurnal periodicity in which they circulate in the peripheral blood during the daytime, but migrate to vascular parts of the lungs during the night, where they are considered noncirculatory. Microfilariae circulate in the peripheral blood with a regular periodicity that is dependent on the species of worm. Those of W. bancrofti and B. malayi are nocturnal, whereas those of Loa loa are diurnal</p>\n<p><strong>Highyeild:</strong></p><p>Loa Loa Loiasis is caused by Loa loa and is characterized by transient subcutaneous swellings (Calabar swellings). Occasionally, worms can migrate through thesubconjunctiva, causing conjunctivitis. white, thread-like worms measure 30– 70 × 0.3mm and migrate through the connective tissues. The microfilariae measure 300 × 8 micrometers and appear in the blood during the day. Adults live in the subcutaneous tissues of humans, where they mate and produce wormlike eggs called microfilariae. Microfilariae of Loa loa are sheathed and measure 230-250 µm long in stained blood smears and 270-300 µm in 2% formalin. However, symptoms can appear as early as 4 months after a bite. Treatment: DEC or albendazole.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Wuchereria bancrofti - no diurnal variation Option B. Brugia malayi - no diurnal variation Option D. Mansonella perstans- no diurnal variation Option B, A, and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following parasite does not enter the body by skin penetration:", "options": [{"label": "A", "text": "Dracunculus", "correct": true}, {"label": "B", "text": "Necator", "correct": false}, {"label": "C", "text": "Ancylostoma", "correct": false}, {"label": "D", "text": "Strongyloides", "correct": false}], "correct_answer": "A. Dracunculus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dracunculus Dracunculiasis (guinea worm infection) occurs after drinking water containing crustaceans infected with the larvae of D. medinensis The disease has been eradicated and India was declared a guinea worm disease-free country by WHO in 2000. After ingestion of crustaceans containing D. medinensis, the larvae are released in the stomach, which pass into the small intestine, penetrate the mucosa, and reach the retroperitoneum where they mature and mate. About a year later, the female worm migrates to the subcutaneous tissues of the legs. The overlying skin ulcerates, and a portion of the worm protrudes. On contact with water, large numbers of larvae are released where they are ingested by crustaceans, and the lifecycle continues.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about Ascaris lumbricoides except:", "options": [{"label": "A", "text": "Largest intestinal nematode in man", "correct": false}, {"label": "B", "text": "Infecting stage is the larva", "correct": true}, {"label": "C", "text": "Site of location is the small intestine", "correct": false}, {"label": "D", "text": "Portal of entry is the alimentary canal", "correct": false}], "correct_answer": "B. Infecting stage is the larva", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Infecting stage is the larva Ascaris lumbricoides is the \"largest roundworm\" of humans, growing to a length of up to 35 cm. It is one of several species of Ascaris. An ascarid nematode of the phylum Nematoda, it is the most common parasitic worm in humans. It is transmitted by consumption of food or water, contaminated with eggs.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Symptoms of pruritis ani usually clear up in 1-3 weeks, but in severe cases, it can take longer. The condition can also reappear. If it does, the treatment is the same. Pruritus ani is caused by:", "options": [{"label": "A", "text": "Ascariasis", "correct": false}, {"label": "B", "text": "Ankylostoma", "correct": false}, {"label": "C", "text": "Oxyuriasis", "correct": true}, {"label": "D", "text": "Tapeworm", "correct": false}], "correct_answer": "C. Oxyuriasis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oxyuriasis Pruritus ani is defined as intense chronic itching affecting peri-anal skin. It affects 1–5% of the population, is four times more common in men, and is most frequent between the fourth and sixth decades of life. The symptoms range from mild to intense and depression may result when these are severe and persistent. Oxyuriasis-infestation with or disease caused by pinworms (family Oxyuridae). The most common clinical manifestation of E. vermicularis infection is pruritus ani. This is attributable to the expulsion of eggs by gravid females onto the skin of the anus . When a very heavy infection is present, an eczematous reaction with bacterial superinfection may occur.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B, A, and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The major symptom of enterobiasis is itching in the anal area. There may also be restlessness and difficulty sleeping. Secondary bacterial infections may develop in the areas that are constantly scratched and, very infrequently, the vagina may become involved in young girls. In which of the following life cycle stages is enterobiasis transmitted?", "options": [{"label": "A", "text": "Larva", "correct": false}, {"label": "B", "text": "Egg", "correct": true}, {"label": "C", "text": "Adult", "correct": false}, {"label": "D", "text": "Cyst", "correct": false}], "correct_answer": "B. Egg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Egg Enterobiasis is contracted by ingesting the eggs of pinworms, which may be carried on fingernails, clothing, toys, or bedding . The eggs may also be inhaled in the dust. The infection may be transmitted to others by hand-to-mouth contact with contaminated food or objects. Pinworm infection (called enterobiasis or mydriasis) causes itching around the anus which can lead to difficulty sleeping and restlessness. Symptoms are caused by the female pinworm laying her eggs. Symptoms of pinworm infection usually are mild and some infected people have no symptoms.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The major symptom of enterobiasis is itching in the anal area. There may also be restlessness and difficulty sleeping. Secondary bacterial infections may develop in the areas that are constantly scratched and, very infrequently, the vagina may become involved in young girls. Which of the following is the drug of choice in treating enterobiasis?", "options": [{"label": "A", "text": "Mebendazole", "correct": true}, {"label": "B", "text": "Metronidazole", "correct": false}, {"label": "C", "text": "Piperazine", "correct": false}, {"label": "D", "text": "Praziquantel", "correct": false}], "correct_answer": "A. Mebendazole", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mebendazole Enterobiasis is contracted by ingesting the eggs of pinworms, which may be carried on fingernails, clothing, toys, or bedding. Treatment: Albendazole (400mg stat, repeated at 2 weeks) or mebendazole (100mg stat, repeated at 2 weeks) Pyrantel pamoate is an alternative but has GI, hepatic, and neurological side effects. Ivermectin can also be used.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Itching around the rectum is commonly caused by the pinworm, Enterobius vermicularis. Which of the following is false regarding pinworms?", "options": [{"label": "A", "text": "It has a simple rectum to the mouth life cycle", "correct": false}, {"label": "B", "text": "Diagnosis is best made by a stool O&P exam", "correct": true}, {"label": "C", "text": "It is highly contagious infecting several members of a family at the same time", "correct": false}, {"label": "D", "text": "The egg is oval, flat on one side, and contains a single larva folded over like a safety pin", "correct": false}], "correct_answer": "B. Diagnosis is best made by a stool O&P exam", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Diagnosis is best made by a stool O&P exam The nematode (roundworm) Enterobius vermicularis is widely known as the human pinworm due to the female's long, pointed tail. Enterobius vermicularis, also called pinworm, is one of the most common nematode infections in the world. Diagnosis is made by identifying the worm or its eggs. Worms can sometimes be seen on the skin near the anus or on underclothing, pajamas, or sheets about 2 to 3 hours after falling asleep. Pinworm eggs can be collected and examined using the “tape test” as soon as the person wakes up. Originally, E. vermicularis was named Oxyuris vermicularis. Humans are the only natural host for this infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. The nematode (roundworm) Enterobius vermicularis is widely known as the human pinworm due to the female's long, pointed tail. Highly contagious it is. The most common means of diagnosing pinworm infection is via the “Scotch tape” test, where a clear adhesive cellulose tape is applied to the anal area early in the morning before bathing or defecation. Option D. This is then observed under a microscope for the presence of pinworm eggs. The egg is oval, flat on one side, and contains a single larva folded over like a safety pin Options A, C, and D. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Visceral larva migrans is a zoonotic infestation by certain nematode parasites which are found in dogs and cats. 'Visceral larva migrants' is produced by:", "options": [{"label": "A", "text": "Ancylostoma braziliense", "correct": false}, {"label": "B", "text": "Enterobius vermicularis", "correct": false}, {"label": "C", "text": "Brugia malayi", "correct": false}, {"label": "D", "text": "Toxocara canis", "correct": true}], "correct_answer": "D. Toxocara canis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxocara canis The main clinical presentations of toxocariasis are visceral larva migrans (VLM) and ocular larva migrans (OLM), although most infections are asymptomatic.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. Are incorrect. VLM occurs mostly in preschool children, the larvae invade multiple tissues (liver, lung, skeletal muscle,) and cause various nonspecific symptoms (e.g. fever, myalgia, weight loss, cough, rashes, hepatosplenomegaly) with eosinophilia. Migration to the central nervous system (neuro toxocariasis or neural larva migrans (NLM)) is uncommon and can cause eosinophilic meningoencephalitis. Death can occur in instances of severe cardiac, pulmonary, or neurologic involvement.</p>\n<p><strong>Extraedge:</strong></p><p>OLM caused by Toxocara spp. OLM (Ocular larva migrans), the larvae produce various ophthalmologic lesions and may cause diffuse unilateral subacute neuroretinitis (DUSN) . Involvement is unilateral and associated visual impairment usually presents with uveitis, retinitis, or endophthalmitis; permanent visual damage, or blindness . OLM most often occurs in older children or young adults, who uncommonly have visceral manifestations.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Visceral larva migrans is a zoonotic infestation by certain nematode parasites which are found in dogs and cats. The most common cause of Visceral Larva Migrans:", "options": [{"label": "A", "text": "Ancylostoma braziliense", "correct": false}, {"label": "B", "text": "Strongyloides stercoralis", "correct": false}, {"label": "C", "text": "Enterobius vermicularis", "correct": false}, {"label": "D", "text": "Toxocara canis", "correct": true}], "correct_answer": "D. Toxocara canis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251057739-QTDV067019IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxocara canis Visceral larva migrans (VLM) is a human infection with certain parasites found in the intestines of dogs and cats. Visceral larva migrans (VLM) is a condition in humans caused by the migratory larvae of certain nematodes, humans being dead-end hosts. Nematodes causing such zoonotic infections are Baylisascaris procyonis, Toxocara canis, Toxocara cati, and Ascaris suum. Visceral larva migrans is a zoonotic infestation by certain nematode. These are roundworm larvae of the species Toxocara canis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C Are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24 year old primi in her 8th month of pregnancy develops a positive IgM titer to T. Gondii for the first time. She should be advised by her physician that:", "options": [{"label": "A", "text": "That this child and all future fetuses would be infected", "correct": false}, {"label": "B", "text": "That the newborn with positive anti-toxoplasma IgG response should be treated with anti-parasitics", "correct": false}, {"label": "C", "text": "That future infections can be avoided by proper vaccination and deworming of cats", "correct": false}, {"label": "D", "text": "That chorioretinitis can be prevented by drug treatment of an infant with positive IgM response.", "correct": true}], "correct_answer": "D. That chorioretinitis can be prevented by drug treatment of an infant with positive IgM response.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>That chorioretinitis can be prevented by drug treatment of an infant with positive IgM response.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Once infected in a particular pregnancy does not harm future pregnancies, it incorrect option. Caught during pregnancy, toxoplasmosis can cause miscarriage, stillbirth, or damage to the baby's brain and other organs, particularly the eyes. However, most babies born with toxoplasmosis have no obvious damage at birth but develop symptoms, usually eye damage, during childhood or even adulthood. Critically, when a T gondii infection is acquired in pregnancy, the parasite can be transmitted across the placenta to the fetus, resulting in congenital toxoplasmosis. Option B. If infection occurred after the 16th week of pregnancy, or if tests show that your unborn child has toxoplasmosis, you may be given pyrimethamine and sulfadiazine, and folinic acid (leucovorin). The Toxoplasma infection can be treated during pregnancy with antibiotic medication. The earlier the infection is identified and treated, the better. Option C. If primary T gondii infection is confirmed during pregnancy, treatment is used for fetal prophylaxis or to decrease the disease severity. So, Options B, C, and A. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The Sabin-Feldman dye test, immunofluorescent antibody test, ELISA, IgG avidity test, and agglutination and differential agglutination test can be used for the detection of IgG antibodies. These tests are positive within 1 to 2 weeks after the infection and persist indefinitely. Sabin Feldman dye test is done for:", "options": [{"label": "A", "text": "Toxoplasma", "correct": true}, {"label": "B", "text": "Ascaris", "correct": false}, {"label": "C", "text": "Filaria", "correct": false}, {"label": "D", "text": "Histoplasma", "correct": false}], "correct_answer": "A. Toxoplasma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxoplasma A Sabin–Feldman dye test is a serologic test to diagnose toxoplasmosis. The test is based on the presence of certain antibodies that prevent methylene blue dye from entering the cytoplasm of Toxoplasma organisms in the presence of compliments. The unstained cells are considered positive tests. Patient serum is treated with Toxoplasma trophozoites and complements as activator, and then incubated.</p>\n<p><strong>Highyeild:</strong></p><p>Sabin Feldman Test When live virulent tachyzoites of Toxoplasma gondii are incubated with normal serum, tachyzoites become swollen and stain deeply blue when methylene blue is added. Tachyzoites when incubated in serum-containing specific antibodies to Toxoplasma gondii, under the same conditions, appear thin and distorted and are not stained when the dye is added. This is due to the activation of the complement system and lysis of the organisms. Dilution of serum at which half of the organisms are not killed (stained) and the other half are killed (unstained) is reported as antibody titer. Differentiation of lysed from nonlysed organisms may be readily accomplished under phase contrast microscopy, in that case, staining is not required.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Ascaris lumbricoides is the \"large roundworm\" of humans, growing to a length of up to 35 cm. It is one of several species of Ascaris. Option C. Lymphatic filariasis is spread by infected mosquitoes. Their bites deposit a parasite that travels to the lymph system. Option D. Histoplasmosis is an infection caused by a fungus called Histoplasma. The fungus lives in the environment, particularly in soil that contains large amounts of bird or bat droppings. Options B, C, and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Toxoplasmosis can be a sexually transmitted infection with serious clinical consequences. Regarding congenital toxoplasmosis, the false statement is:", "options": [{"label": "A", "text": "IgA is better than IgM in diagnosis", "correct": false}, {"label": "B", "text": "Diagnosed by detection of IgM in cord blood.", "correct": false}, {"label": "C", "text": "Dye test is the gold standard and it detects IgG", "correct": false}, {"label": "D", "text": "Avidity test must be done to differentiate IgA and IgM.", "correct": true}], "correct_answer": "D. Avidity test must be done to differentiate IgA and IgM.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Avidity test must be done to differentiate IgA and IgM. Antibody avidity describes the strength with which an antibody binds to a complex antigen. Several methods have been described for determining relative antibody avidity to different types of antigens. The IgG avidity test measures antibody binding force, which is low in the early stage after primary infection but generally increases with time . This helps in identifying whether the infection was recent or remote and therefore the chances of the fetus being infected can be accessed better. High toxoplasma IgG avidity indicates that an infection likely occurred at least 3-4 months earlier In the diagnosis of congenital infections, IgM testing is unreliable as this antibody may persist for a longer period and may also be increased in reactivation of this disease. The exact diagnosis of the congenital infection is crucial as we are dealing with drastic clinical decision-making about the fetus.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options:- Options A, B, and C. Are correct.</p>\n<p><strong>Extraedge:</strong></p><p>Avidity Vs Affinity</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A person working in which of the following profession can have the following presentation?", "options": [{"label": "A", "text": "Person working in the butcher house", "correct": false}, {"label": "B", "text": "Lifeguard in the swimming pool", "correct": false}, {"label": "C", "text": "Kennel worker", "correct": true}, {"label": "D", "text": "Poultry farm worker", "correct": false}], "correct_answer": "C. Kennel worker", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251058384-QTDV067025IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Kennel worker The picture depicts the Cutaneous larva migrans (creeping eruption) is characterized by an erythematous, pruritic, serpiginous skin lesion. It is usually caused by the dog or cat hookworm Ancylostoma braziliense or Ancylostoma caninum.</p>\n<p><strong>Highyeild:</strong></p><p>Cutaneous larva migrans (creeping eruption) It is usually caused by the dog or cat hookworm Ancylostoma braziliense or Ancylostoma caninum. Other worms associated- Are unicinaria stenocephala, Bunostomum phlebotomy, S. stercoralis, and Gnathostoma spiniform. The larvae infect dogs or cats by burrowing through the skin. The adults live in the host’s intestine and shed eggs in the feces, which develop into larvae in the sandy soil. Clinical features Cutaneous disease— the larvae penetrate the skin of humans (an accidental host) , causing tingling, itching, and vesicle formation. They then migrate through the skin, causing a characteristic raised, erythematous, pruritic, serpiginous track. In severe infections, many tracks may be seen. Treatment: Ivermectin or albendazole</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. Are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Sputum examination is not useful in the diagnosis of which of the following?", "options": [{"label": "A", "text": "Trichuris trichiura", "correct": true}, {"label": "B", "text": "A. Duodenale", "correct": false}, {"label": "C", "text": "Paragonimiasis", "correct": false}, {"label": "D", "text": "Strongyloides", "correct": false}], "correct_answer": "A. Trichuris trichiura", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichuris trichiura Trichuriasis cant be diagnosed by sputum examination</p>\n<p><strong>Highyeild:</strong></p><p>Parasites that may be associated with the lung Species Forms seen in lung Disease manifestations Ascaris species Filariform larvae Loeffler's syndrome (wheezing and eosinophils) look for lateral alae Hookworm Filariform larvae Loeffler's syndrome Strongyloides stercoralis Filariform larvae Loeffler's syndrome and hyperinfection syndrome Dirofilaria Filariform larvae Necrotic nodules in lung (coin lesions) correlate with serology Paragonimus species Adult fluke Eggs in lung, sputum, stool Chronic pulmonary infection mimicking TB Echinococcus species Protoscoleces and hooklets in hydatid sand Cystic lesions in the lung are less common than those seen associated with liver Maggots Various instars Myiasis Schistosoma species Adult worm Rare location</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B and D. In strongyloidiasis and A. duodenale infection, larvae can rarely be seen in sputum when the same is passing through the lungs and climbing up the trachea to reach the digestive tract. Option C. westermani (infection by lung fluke), eggs can be seen in sputum</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 31 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 35-year-old man presents to your OPD complaining of several days of abdominal discomfort and early satiety. His blood pressure is 130/70 mmHg, RR is 17/min. Upper GI endoscopy is done. on endoscopy, mucosal rigidity and hyperplasia are seen in the stomach, and a biopsy is taken. Microscopic analysis of the biopsy shows sheets of atypical lymphocytes. Diagnosis of mucosa-associated lymphoid tissue (MALT) lymphoma is made. All are true about organisms responsible for this condition except?", "options": [{"label": "A", "text": "It is gram-negative bacteria", "correct": false}, {"label": "B", "text": "Warthin starry stain is used to demonstrate the organism", "correct": false}, {"label": "C", "text": "Cag and vac increase its virulence", "correct": false}, {"label": "D", "text": "It is nonmotile", "correct": true}], "correct_answer": "D. It is nonmotile", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It is nonmotile From the given clinical information diagnosis is mucosa-associated lymphoid tissue (MALT) lymphoma and the responsible organism is Helicobacter pylori.</p>\n<p><strong>Highyeild:</strong></p><p>Pylori is a Gram-negative spiral rod, motile by a unipolar tuft of lophotrichous flagella. It grows on chocolate agar or campylobacter media under microaerophilic conditions, with 5-20% CO2 and pH 6-7. At 37 degrees C, colonies take 2-7 days to develop. It produces oxidase, catalase, phosphatase, and H2S. It is strongly urease positive. Peptic ulcer disease occurs in a proportion of the infected population. Chronic atrophic gastritis may be seen in the later stages. The infection is recognized as a risk factor for gastric malignancies such as adenocarcinoma and 'mucosa-associated lymphoid tissue' (MALT) lymphomas.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The mucosa-associated lymphoid tissue (MALT) lymphoma-responsible organism is Helicobacter pylori. It is a gram-negative spiral rod, motile by a unipolar tuft of lophotrichous flagella. Option B. The diagnosis of gastritis and H pylori infection can be made histologically. A gastroscopy procedure with biopsy is required. Routine stains demonstrate gastritis, stains used for gym sustain, or special silver stains such as within starry stains which show the curved or spiral-shaped organisms. Option C. pylori is a gram-negative, motile, spiral rod.</p>\n<p><strong>Extraedge:</strong></p><p>Warthin starry stain is used to demonstrate organism</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old patient presented with a complaint of severe epigastric pain. A gastric biopsy was done and the sample was sent for bacterial examination. The sample was cultured on blood agar and Skirrow’s media in the microaerophilic environment at 37°C and 42°C. On the 5th day growth was observed in plates incubated at 37°C and is Catalase and oxidase positive. There was no growth on the plate incubated at 42°C. Direct microscopy from the colonies shows spiral gram-negative bacilli. Which of the following is the most likely causative agent?", "options": [{"label": "A", "text": "Campylobacter jejuni", "correct": false}, {"label": "B", "text": "Campylobacter fetus", "correct": false}, {"label": "C", "text": "Helicobacter pylori", "correct": true}, {"label": "D", "text": "Vibrio alginolitycus", "correct": false}], "correct_answer": "C. Helicobacter pylori", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Helicobacter pylori pylori are gram-negative spiral rod, that grows well on chocolate agar or campylobacter media such as Skirrow’s media under microaerophilic condition and growth appears usually after 3-6 days of incubation at 37?C.</p>\n<p><strong>Highyeild:</strong></p><p>Pylori is a Gram-negative spiral rod, motile by a unipolar tuft of lophotrichous flagella. It grows on chocolate agar or campylobacter media under microaerophilic conditions, with 5-20% CO2 and pH 6-7. At 37 degrees C, colonies take 2-7 days to develop. It produces oxidase, catalase, phosphatase, and H2S. It is strongly urease positive. Peptic ulcer disease occurs in a proportion of the infected population. Chronic atrophic gastritis may be seen in the later stages. The infection is recognized as a risk factor for gastric malignancies such as adenocarcinoma and 'mucosa-associated lymphoid tissue' (MALT) lymphomas.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A and B. Campylobacter spp. Are gram-negative S-shaped bacilli also grows well on chocolate agar or campylobacter media such as Skirrow’s media under microaerophilic condition and growth appears usually within 48 hours of incubation. Most of the caprices are thermophilic and grow well at 42°C Option D. Vibrio alginolyticus is also curved gram-negative bacilli and oxidase positive and growth usually appears within 48 hours of incubation at 37°C. It usually causes eye, ear, and wound infections. It is the most salt-tolerant Vibrio and can grow at salt concentrations of more than 10%.</p>\n<p><strong>Extraedge:</strong></p><p>pylori is a type of bacteria that infects your stomach. It attacks your stomach and the first part of your small intestine (duodenum). This can cause redness and swelling (inflammation). Many people with the bacteria won't have any symptoms. It can cause open sores called peptic ulcers in your upper digestive tract.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 24-year-old patient presented with a complaint of severe epigastric Gastric biopsy was done and the sample was sent for bacterial examination. A rapid urease test from the tissue sample was positive. The sample was cultured on blood agar and Skirrow’s media in the microaerophilic environment at 37°C and 42°C. On the 5th day growth was observed in plates incubated at 37°C and is Catalase and oxidase positive. There was no growth on the plate incubated at 42°C. Direct microscopy from the colonies shows spiral gram-negative bacilli. Which of the following statements is correct about the most likely causative organism?", "options": [{"label": "A", "text": "Urease enzyme has no role in the pathogenesis of the causative agent.", "correct": false}, {"label": "B", "text": "Virulence is associated with two genes CagA and VacA.", "correct": true}, {"label": "C", "text": "Cytotoxin-associated gene A induces the formation of the vacuole in the cytoplasm of gastric epithelium.", "correct": false}, {"label": "D", "text": "Organism is non-motile and remains inside the gastric mucosal layer.", "correct": false}], "correct_answer": "B. Virulence is associated with two genes CagA and VacA.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Virulence is associated with two genes CagA and VacA. H.pylori are gram-negative spiral rod, that grows well on chocolate agar or campylobacter media such as Skirrow’s media under microaerophilic condition and growth appears usually after 3-6 days of incubation at 37ᵒC. Rapid urease test from tissue biopsy is positive for H.pylori.</p>\n<p><strong>Highyeild:</strong></p><p>H.pylori secretes two toxins : Vacuolating cytotoxin (VacA) Cytotoxin-associated gene A (CagA)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It produces abundant urease that catalyzes urea hydrolysis to produce ammonia which in turn buffers the gastric acid Option C. VacA: induces the formation of vacuoles in the cytoplasm of epithelial cells CagA: helps the bacterium to modulate certain aspects of the host cell’s metabolism like expression of proto-oncogenes, and cytoskeleton rearrangement. Option D. pylori are highly motile (conferred by 4 to 8 unipolar flagella), which allows it to remain in the viscous environment of the mucus layer overlying the gastric mucosa.</p>\n<p><strong>Extraedge:</strong></p><p>Helicobacter pylori, previously known as Campylobacter pylori, is a gram-negative, microaerophilic, spiral bacterium usually found in the stomach. Its helical shape is thought to have evolved in order to penetrate the mucoid lining of the stomach and thereby establish infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 13 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A previously healthy 23-year-old man comes to the office due to abrupt-onset high fever, chills, headache, and weakness that developed during a hiking and camping trip to Beed. His initial symptoms were quickly followed by intensely painful swellings in the groin. Physical examination shows tender and enlarged inguinal lymph nodes with overlying erythematous skin. Blood cultures and fluid aspirated from the lymph nodes grow gram-negative cocco-bacilli, which resemble a closed safety pin on special staining. Which of the following is the most likely source of this patient's infection?", "options": [{"label": "A", "text": "Bats", "correct": false}, {"label": "B", "text": "Poultry", "correct": false}, {"label": "C", "text": "Rodents", "correct": true}, {"label": "D", "text": "Sheep", "correct": false}], "correct_answer": "C. Rodents", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rodents This patient's acute febrile illness with tender, erythematous inguinal lymphadenopathy likely indicates bubonic plague, The causative pathogen is Yersinia pestis, a gram-negative coccobacillus that exhibits bipolar staining (resembling a safety pin) on Giemsa or Wright stain . Although many small mammals can harbour bacteria, rodents (eg, rats) are the primary environmental reservoir. Transmission to humans primarily occurs via rodent flea bite. Following cutaneous injection, the organism travels to regional lymph nodes and triggers a significant inflammatory reaction. Manifestations typically begin with acute fever, chills, weakness, and headache; buboes (painful, swollen, erythematous lymph nodes) develop shortly thereafter. Treatment with antibiotics (eg, aminoglycoside) is generally curative.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Bats transmit rabies , which is characterized by nonspecific symptoms (eg, fever, myalgias, malaise) followed by hydrophobia, pharyngeal spasms, hyperactivity, coma, and death. Rabies is caused by a virus (Lyssavirus), not a gram-negative coccobacillus. Option B. Non-typhoidal Salmonella, a motile gram-negative bacillus, is often transmitted via the ingestion of contaminated poultry. It causes febrile diarrhoea, not acute regional inflammatory lymphadenopathy. Option D. Sheep hides can transmit anthrax , which is typically characterized by a necrotic skin ulcer with extensive surrounding edema and regional lymphadenopathy. Bacillus anthracis, the causative agent, is a gram-positive, spore-forming rod.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A notable virulence factor of pathogenic Yersinia is the ability to paralyze phagocytes and so prevent ingestion of bacteria. What mechanism enables Yersinia to do this?", "options": [{"label": "A", "text": "Quorum-sensing system.", "correct": false}, {"label": "B", "text": "Two-component regulatory system.", "correct": false}, {"label": "C", "text": "Type III secretion system.", "correct": true}, {"label": "D", "text": "Iron-acquisition system.", "correct": false}], "correct_answer": "C. Type III secretion system.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Type III secretion system. Yersinia pestis, the causative agent of plague, utilizes a plasmid-encoded type III secretion system (T3SS) to aid it with its resistance to host defences. This system injects a set of effector proteins known as Yops (Yersinia outer proteins) into the cytosol of host cells that come into contact with the bacteria.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Quorum-sensing system. - not correct. It is used by bacteria to produce biofilm, develop resistance etc. Option B. Two-component regulatory system. - not correct Option D. Iron-acquisition system. - not correct Options A, B & D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following diseases are transmitted by the below-shown vector?", "options": [{"label": "A", "text": "Epidemic relapsing fever, epidemic typhus", "correct": false}, {"label": "B", "text": "Kala-azar, Scabies", "correct": false}, {"label": "C", "text": "Plague, typhus fever", "correct": true}, {"label": "D", "text": "Chagas disease, Trench fever", "correct": false}], "correct_answer": "C. Plague, typhus fever", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689248447931-QTDV056003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Plague, typhus fever This is an image of a flea. Plague is an infectious disease caused by Yersinia pestis bacteria, usually found in small mammals and their fleas . The disease is transmitted between animals via their fleas. Flea-borne (murine) typhus is a disease caused by a bacteria called Rickettsia typhi. Flea-borne typhus is spread to people through contact with infected fleas. Fleas become infected when they bite infected animals, such as rats, cats, or opossums.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. By body louse Option B. Scabies by mite and Kala-Azar by female phlebotomine sandfly. Option D. Chagas by kissing bugs and trench fever by the body louse</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 13 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 25-year-old man with acquired immune deficiency disease (AIDS) has malabsorption, chronic abdominal pain, low-grade fever, and non-bloody diarrhea. In fecal smears, large numbers of oocysts containing four sporozoites were observed. Which of the following organisms is most likely the etiological agent?", "options": [{"label": "A", "text": "Cryptosporidium parvum", "correct": true}, {"label": "B", "text": "Entamoeba histolytica", "correct": false}, {"label": "C", "text": "Giardia lamblia", "correct": false}, {"label": "D", "text": "Trichomonas vaginalis.", "correct": false}], "correct_answer": "A. Cryptosporidium parvum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptosporidium parvum All five organisms are protozoa. There are two intestinal protozoa specifically associated with AIDS that can cause transient diarrhea in immunocompetent individuals, but can cause debilitating, and potentially life-threatening, chronic diarrhea in AIDS patients. These organisms are C. parvum with no effective drug therapy, and Isospora belli treated with folate antagonists, such as trimethoprim-sulfamethoxazole.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Entamoeba histolytica- Quadrinucleate cyst is seen in feces. may cause diarrhea, but they are not closely associated with AIDS. Option C. Giardia lamblia - Quadrinucleate cyst is seen in feces. may cause diarrhea, but they are not closely associated with AIDS. Option D. Trichomonas vaginalis- cause Vaginitis. Microsporidia may cause severe, persistent, watery diarrhea in AIDS patients, but they produce spores rather than oocysts. T. solium is a pork tapeworm that occasionally may cause diarrhea .</p>\n<p><strong>Extraedge:</strong></p><p>Cryptosporidium is a microscopic parasite that causes the diarrheal disease cryptosporidiosis. Both the parasite and the disease are commonly known as “Crypto.” There are many species of Cryptosporidium that infect animals, some of which also infect humans.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old male presented with complaints of lower abdominal pain, nausea, vomiting, and weakness for 3 days. On general examination patient vitals are stable. Blood examination reveals eosinophilia. The attending physician suspects a parasitic infection. All the following are the intestinal protozoa that can cause the above symptoms in the patient except?", "options": [{"label": "A", "text": "Entamoeba Histolytica", "correct": false}, {"label": "B", "text": "Trichomonas", "correct": true}, {"label": "C", "text": "Giardia lamblia", "correct": false}, {"label": "D", "text": "Cyclospora", "correct": false}], "correct_answer": "B. Trichomonas", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichomonas Trichomonas vaginalis is a protozoan organism that is an inhabitant of the vagina causing vaginal Trichomoniasis.</p>\n<p><strong>Highyeild:</strong></p><p>WET MOUNT Specimen is collected by a swab from lateral &anterior fornices of the vagina. It is mixed with a drop of saline & a cover slip is placed over it. Microscopy shows: T.vaginalis shows jerky & twitching motility. PMN'S and Bacterial flora. Sensitivity of wet mount prep with vaginal secretion is 50-70%. Amies gel agar transport medium can maintain the viability for culture of T.vaginalis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. intestinal protozoa include Entamoeba Histolytica, Giardia lamblia, Cyclospora, corpora, Cryptosporidium & Balantidium coli.</p>\n<p><strong>Extraedge:</strong></p><p>Trichomoniasis is among the most common sexually transmitted infections. Risk factors include multiple sexual partners and not using condoms during sex. Trichomoniasis causes a foul-smelling vaginal discharge, genital itching and painful urination in women. Men typically have no symptoms. Complications include a risk of premature delivery for pregnant women.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male patient was recognized as HIV positive. The patient has loose motions, lower abdominal pain, and also had a fever for three days. On examination, the patient was vitally stable. His Glasgow Coma scale (GCS) was 15/15. Sonography and computed tomography (CT) scans of the abdomen, pelvis, and lung X-ray were normal. Immunological and biological studies showed increased eosinophil count, and increased C-reactive protein. The attending physician is expecting a parasitic infection. Which of the following tissue protozoa is not transmitted by Vector-borne mechanisms?", "options": [{"label": "A", "text": "Leishmaniasis", "correct": false}, {"label": "B", "text": "Trypanosomiasis", "correct": false}, {"label": "C", "text": "Babesiosis", "correct": false}, {"label": "D", "text": "Toxoplasmosis", "correct": true}], "correct_answer": "D. Toxoplasmosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxoplasmosis Toxoplasmosis is caused by toxoplasma gondii which is transmitted by the Feco-oral route. It is not transmitted by any vectors</p>\n<p><strong>Highyeild:</strong></p><p>People can be infected by: Accidental ingestion of oocysts after cleaning a cat's litter box when the cat has shed Toxoplasma in its feces. Accidental ingestion of oocysts after touching or ingesting anything that has come into contact with a cat's feces that contain Toxoplasma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. leishmaniasis is transmitted by Phlebotomus sandfly. Option B. trypanosomiasis is caused by Trypanosoma species which is transmitted by the tsetse fly. Option C. Babesiosis is caused by Babesia transmitted by Ixodes tick.</p>\n<p><strong>Extraedge:</strong></p><p>Toxoplasma gondii is an intestinal coccidium that parasitizes members of the cat family as definitive hosts and has a wide range of intermediate hosts. Infection is common in many warm-blooded animals, including humans. In most cases infection is asymptomatic, but devastating disease can occur.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not true about various blood and tissue protozoa?", "options": [{"label": "A", "text": "Definitive hosts for leishmaniasis are humans", "correct": false}, {"label": "B", "text": "Definite host for plasmodium is a female anopheles mosquito", "correct": false}, {"label": "C", "text": "Humans are the definitive host for Trypanosoma", "correct": false}, {"label": "D", "text": "The intermediate host of toxoplasma is a cat", "correct": true}], "correct_answer": "D. The intermediate host of toxoplasma is a cat", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The intermediate host of toxoplasma is a cat The Definitive host of toxoplasma is a cat in which the sexual cycle occurs. Man is the intermediate host.</p>\n<p><strong>Highyeild:</strong></p><p>People can be infected by: Accidental ingestion of oocysts after cleaning a cat's litter box when the cat has shed Toxoplasma in its feces. Accidental ingestion of oocysts after touching or ingesting anything that has come into contact with a cat's feces that contain Toxoplasma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. For leishmania, a human is a definite host and Phlebotomus sandfly is the intermediate host which is a vector. Option B. For plasmodium female anopheles mosquito is the definitive host and human is an intermediate host. Option C. For trypanosomiasis, the human is the definitive host and the tsetse fly is the intermediate host and the vector.</p>\n<p><strong>Extraedge:</strong></p><p>The toxoplasmosis parasite can cause a long-term infection. Following infection, a small number of parasites can remain locked inside cysts within certain parts of the body, such as the brain, lungs and muscle tissue. Such dormant infections persist for life and can reactivate in the immunosuppressed person</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 20-year-old presented to the physician with a lower GI bleed. The patient gave a history of passing stools with mucous & blood for 3 days associated with lower abdominal pain & discomfort. The patient is dehydrated & treated with an oral rehydration solution. A stool examination revealed trophozoites & cysts. Which of the following is considered the infective form of the causative organism?", "options": [{"label": "A", "text": "Quadri-nucleate cyst", "correct": true}, {"label": "B", "text": "Binucleate cyst", "correct": false}, {"label": "C", "text": "Trophozoite", "correct": false}, {"label": "D", "text": "Metacystic trophozoite", "correct": false}], "correct_answer": "A. Quadri-nucleate cyst", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Quadri-nucleate cyst The Above clinical features are suggestive of invasive intestinal amebiasis. so, the infective form is a Quadri-nucleate cyst.</p>\n<p><strong>Highyeild:</strong></p><p>Entamoeba histolytica Causes Amoebiasis. Geog. Distribution: cosmopolitan Habitat: caecum and sigmoido- rectal region of man. Infective stage: Quadrinucleate cyst. Mode of infection: Eating raw vegetables (salad) Drinking water Heteroinfection Flies and food handlers (cyst passer) Faeco-oral Autoinfection</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The remaining options are not infective forms of amoebiasis. Option B. Binucleate cyst transforms into a quadrangulate cyst in the environment, which is the infective form of amoebic dysentery. Option C. Trophozoite inhabits the intestine & trophozoite with a feeding vacuole filled with RBC is a diagnostic feature. Option D. Metacystic trophozoites are released from the excystation in the intestine.</p>\n<p><strong>Extraedge:</strong></p><p>The toxoplasmosis parasite can cause a long-term infection. Following infection, a small number of parasites can remain locked inside cysts within certain parts of the body, such as the brain, lungs and muscle tissue. Such dormant infections persist for life and can reactivate in the immunosuppressed person</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 15 yrs. old male presented with Diarrhea characterized by stool with blood & mucous for 2 days. A wet saline mount of the stool examination revealed quadrinucleate cysts with trophozoites. Which of the following is useful to differentiate pathogenic vs non-pathogenic variants of the causative organism?", "options": [{"label": "A", "text": "CECT contrast-enhanced computed tomography", "correct": false}, {"label": "B", "text": "Stool examination", "correct": false}, {"label": "C", "text": "Zymodeme pattern analysis", "correct": true}, {"label": "D", "text": "ELISA enzyme-linked immunoassay", "correct": false}], "correct_answer": "C. Zymodeme pattern analysis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Zymodeme pattern analysis Diagnosis- invasive intestinal amebiasis caused by E.histolytica.</p>\n<p><strong>Highyeild:</strong></p><p>The zymodeme pattern (isoenzyme pattern) is based on electrophoretic mobility and Histolyticum is classified into 22 strains. However, only 9 strains are invasive therefore we can differentiate invasive and non-invasive strains by this method.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The remaining techniques can’t differentiate between invasive and noninvasive strains of amoeba Option A. CECT contrast-enhanced computed tomography is useful in the diagnosis of extra-intestinal amoebiasis Option B. Stool examination reveals quadrinucleate cysts & amoebic trophozoites with engulfed erythrocytes. Option D. ELISA enzyme-linked immunoassay is also useful in the diagnosis of Amoebic dysentery & extra-intestinal amoebiasis</p>\n<p><strong>Extraedge:</strong></p><p>Amebiasis is an intestinal (bowel) illness caused by a microscopic (tiny) parasite called Entamoeba histolytica, which is spread through human feces (poop). Often there are no symptoms, but, sometimes it causes diarrhea (loose stool/poop), nausea (a feeling of sickness in the stomach), and weight loss.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 18-year-old male presented to the physician with a lower GI bleed. Patient gave a history of passing stools with mucous & blood for 3 days associated with lower abdominal pain & discomfort. Sigmoidoscopy was performed on the patient which revealed the following findings. Which of the following is the Drug of choice for the patient’s medical condition", "options": [{"label": "A", "text": "i/v ceftriaxone", "correct": false}, {"label": "B", "text": "i/v metronidazole", "correct": true}, {"label": "C", "text": "i/v hydrocortisone", "correct": false}, {"label": "D", "text": "i/v LAMB Lentigines, Atrial myxomas, Mucocutaneous myxomas, and Blue nevi.", "correct": false}], "correct_answer": "B. i/v metronidazole", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506970442-QTDV022007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>i/v metronidazole The given image shows a flask-shaped ulcer that is seen in amoebic dysentery. so the treatment given for amoebic dysentery is i.v. metronidazole. (Drug of choice)</p>\n<p><strong>Highyeild:</strong></p><p>Flask-shaped ulcer seen in amoebic dysentery. Treatment given for amoebic dysentery is i.v. metronidazole. (Drug of choice)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and D. All other options are not Drug of choice in the treatment of amoebic dysentery.</p>\n<p><strong>Extraedge:</strong></p><p>Amoebiasis infection is most common in tropical areas with untreated water. It spreads through drinking or eating uncooked food, such as fruit, that may have been washed in contaminated local water. If symptoms occur, they may be mild and include cramping and diarrhoea. Bloody stools, fever and, rarely, liver abscess may occur in severe cases.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old male presented with lower abdominal pain & discomfort with a history of the passage of stools with mucous & blood. A presumptive diagnosis of amoebic dysentery is made & a stool examination was performed on the patient's stool sample. Which of the following finding is a diagnostic feature of entamoeba histolyticum infection?", "options": [{"label": "A", "text": "Feeding vacuole of the trophozoite filled with erythrocytes", "correct": true}, {"label": "B", "text": "Sigmoidoscopy revealing longitudinal ulcers", "correct": false}, {"label": "C", "text": "Presence of micronuclei & macronuclei in the trophozoite", "correct": false}, {"label": "D", "text": "All the above", "correct": false}], "correct_answer": "A. Feeding vacuole of the trophozoite filled with erythrocytes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Feeding vacuole of the trophozoite filled with erythrocytes Feeding the vacuole of the trophozoite filled with erythrocytes in the stool microscopic examination is a characteristic & diagnostic feature of Entamoeba histolytica.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenic Entamoeba trophozoites have a single nucleus, which has a centrally placed karyosome and uniformly distributed peripheral chromatin</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Sigmoidoscopy revealing longitudinal ulcers is characteristic of enteric fever (typhoid) Option C. Presence of micronuclei & macronuclei in the trophozoite characteristic of Balantidium coli(ciliates).</p>\n<p><strong>Extraedge:</strong></p><p>Entamoeba histolytica is an anaerobic parasitic amoebozoan, part of the genus Entamoeba. Predominantly infecting humans and other primates causing amoebiasis, E. histolytica is estimated to infect about 35-50 million people worldwide.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 58-year-old male presented to the physician with a lower GI bleed. The patient gave a history of passing stools with mucous & blood for 3 days associated with lower abdominal pain & discomfort. was diagnosed with intestinal amebiasis and successfully treated with iodoquinol. A month later, he returned to the clinic complaining of the following conditions. Which of the conditions is most likely the result of systemic amebiasis (even though the intestinal infection appears to be cured)?", "options": [{"label": "A", "text": "High periodic fever", "correct": false}, {"label": "B", "text": "Bloody urine", "correct": false}, {"label": "C", "text": "Tender, enlarged liver", "correct": true}, {"label": "D", "text": "Draining skin lesions", "correct": false}], "correct_answer": "C. Tender, enlarged liver", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tender, enlarged liver The most common site of extraintestinal amoebiasis is liver abscess. In liver abscesses only the trophozoite stage is seen but not the cystic stage. A tender, enlarged liver is the clinical manifestation of an amoebic liver abscess</p>\n<p><strong>Highyeild:</strong></p><p>What is the commonest site for amoebic liver abscess? Liver abscess' commonly presents as right upper quadrant abdominal pain and fever, with worsening features associated with abscess rupture.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D. High periodic fever/Bloody urine / Draining skin lesions are usually not seen with amoebic dysentery. The liver is the most common organ involved in extra intestinal amoebiasis.</p>\n<p><strong>Extraedge:</strong></p><p>Amebic liver abscesses are caused by Entamoeba histolytica, a protozoan parasite that is acquired via ingestion of food or water contaminated by human feces. Most infections with E. histolytica are asymptomatic. Among symptomatic infections, amebic dysentery is the most common presentation</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-year-old man was hospitalized for a dysenteric syndrome that had developed during the previous days. Physical examination revealed abdominal pains, fever, vomiting, and more than ten liquid stools per day. the patient reported having been on a hike the previous weekend during which he had drunk water through a hydration pouch bladder. Fresh stool examination showed the following organism. Which of the following organism is responsible for patients’ medical condition", "options": [{"label": "A", "text": "Entamoeba histolytica", "correct": false}, {"label": "B", "text": "Balantidium coli", "correct": true}, {"label": "C", "text": "Giardia lamblia", "correct": false}, {"label": "D", "text": "Cryptosporidium", "correct": false}], "correct_answer": "B. Balantidium coli", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506974824-QTDV022010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Balantidium coli The image shows cilia around the identified organism suggestive of Balantidium coli(ciliates).</p>\n<p><strong>Highyeild:</strong></p><p>Cysts are the stage responsible for the transmission of balantidiasis. The host most often acquires the cyst through the ingestion of contaminated food or water. Following ingestion, excystation occurs in the small intestine, and the trophozoites colonize the large intestine. The trophozoites reside in the lumen of the large intestine and appendix of humans and animals, where they replicate by binary fission, during which conjugation may occur. Trophozoites undergo encystation to produce infective cysts. Some trophozoites invade the wall of the colon and multiply, causing ulcerative pathology in the colon wall. Some return to the lumen and disintegrate. Mature cysts are passed with feces.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- The remaining all other organisms are non-ciliates. Option A. In entamoeba histolytica, quadrinucleate cysts are usually seen. Trophozoites have pseudopodia &engulfed RBC. Option C. giardia lamblia is an intestinal flagellate & has a badminton shape with 4 pairs of flagella & axostyle. Option D. cryptosporidium causes diarrhea in HIV-positive individuals & produces acid-fast oocysts of 5-micron size on average.</p>\n<p><strong>Extraedge:</strong></p><p>Balantidium coli is an intestinal protozoan parasite that causes the infection called balantidiasis. While this type of infection is uncommon in the United States, humans and other mammals can become infected with Balantidium coli by ingesting infective cysts from food and water that is contaminated by feces.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 21-year-old male complains of abdominal pain, bloating, frequent loose stools, steatorrhoea, and loss of energy. He returned a month ago from a 3-week hiking and camping trek to the Mount Everest Base Camp in Nepal. The trek involved only high-elevation hiking since he flew in and out of the 12,000-ft starting point. Which of the following is an important consideration for the diagnosis?", "options": [{"label": "A", "text": "The source and purification of water", "correct": true}, {"label": "B", "text": "The use of insect repellents while hiking", "correct": false}, {"label": "C", "text": "The presence of domestic animals on the route", "correct": false}, {"label": "D", "text": "The degree of contact with villagers in the route", "correct": false}], "correct_answer": "A. The source and purification of water", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The source and purification of water The given clinical features are suggestive of gastroenteritis caused by intestinal protozoa (probably giardia).so it’s important to know the source and purification of water while he went hiking.</p>\n<p><strong>Highyeild:</strong></p><p>What are the characteristics of trophozoites in Giardia lamblia? Trophozoites appear as pear-shaped organisms, measuring 12 to 15 µm (range: 10 to 20 µm). Tropho zeolites contain two anteriorly placed nuclei and 8 flagella (rarely seen because they stain poorly). Cysts appear ovoid to ellipsoid in shape. Nuclei and intracytoplasmic fibrils are visible.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. The use of insect repellents while hiking is important history to be taken in case of vector-borne diseases which usually present as fever/rash & hematological abnormalities. Option C. History of the presence of domestic animals in the route is important for the diagnosis of zoonotic diseases. Option D. The degree of contact with villagers in the route is important in a diagnosis of diseases that are transmitted through direct contact.</p>\n<p><strong>Extraedge:</strong></p><p>Giardiasis spreads through contaminated food or water or by person-to-person contact. It's most common in areas with poor sanitation and unsafe water. Symptoms might include watery diarrhoea alternating with greasy stools. Fatigue, cramps and belching wind may also occur. Some people have no symptoms. Most cases clear up on their own within a few weeks. Severe cases are treated with antibiotics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 21-year-old male complains of abdominal pain, bloating, frequent loose stools, and loss of energy. He returned a month ago from a 3-week hiking and camping trek to the Mount Everest Base Camp in Nepal. The trek involved only high-elevation hiking since he flew in and out of the 12,000-ft starting point. Which one of the following diagnostic tests should be conducted for the patient?", "options": [{"label": "A", "text": "Blood and urine bacteriologic examination", "correct": false}, {"label": "B", "text": "Series of ova and parasite tests and fecal smears.", "correct": true}, {"label": "C", "text": "ELISA enzyme-linked immunoassay. or hemagglutination serologic tests for malaria.", "correct": false}, {"label": "D", "text": "Endoscopic exam for peptic ulcer disease.", "correct": false}], "correct_answer": "B. Series of ova and parasite tests and fecal smears.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Series of ova and parasite tests and fecal smears. The above clinical features are suggestive of gastroenteritis caused by protozoa.so, the best method of diagnosis is by stool examination.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Blood and urine bacteriologic examination are important when we suspect urinary tract infections & hospital-acquired infections Option C. ELISA enzyme-linked immunoassay. or hemagglutination serologic tests for malaria are done if the presentation would have been fever with chills & myalgia etc...in an endemic region Option D. Endoscopic exam for peptic ulcer disease is done for a patient with chronic gastritis & dyspepsia which is a typical clinical presentation of PUD Peptic ulcer disease.)</p>\n<p><strong>Extraedge:</strong></p><p>Giardia infection (giardiasis) can cause a variety of intestinal symptoms, which include: Diarrhea. Gas Foul-smelling, greasy poop that can float. Stomach cramps or pain. Upset stomach or nausea. Dehydration.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 7-year-old boy brought to OPD with frothy diarrhea characterized by foul smelling Bulky stools (steatorrhea) since 3 weeks. It is associated with lower abdominal pain, weakness. Signs of chronic malabsorption are evident with the patient. A stool examination was performed on the patient which reveals the following findings. Which of the following is the characteristic motility of organism causing patient’s condition?", "options": [{"label": "A", "text": "Falling leaf-like", "correct": true}, {"label": "B", "text": "Swarming", "correct": false}, {"label": "C", "text": "Gliding", "correct": false}, {"label": "D", "text": "Tumbling", "correct": false}], "correct_answer": "A. Falling leaf-like", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687506975731-QTDV022013IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Falling leaf-like Given clinical features suggestive of chronic diarrhea caused by giardia and the image clearly shows a badminton rachet appearance with 4 pairs of flagella. It is suggestive of giardia lamblia and the motility shown by it is falling leaf motility</p>\n<p><strong>Highyeild:</strong></p><p>FALLING LEAF MOTILITY 2 sausage shaped para median bodies posterior to sucking disc Motility: Falling leaf Division: Longitudinal binary fission</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Swarming motility -proteus, clostridium tetani Option C. Gliding motility- shown by flagellates Option D. Tumbling motility-listeria</p>\n<p><strong>Extraedge:</strong></p><p>Giardiasis spreads through contaminated food or water or by person-to-person contact. It's most common in areas with poor sanitation and unsafe water. Symptoms might include watery diarrhoea alternating with greasy stools. Fatigue, cramps and belching wind may also occur. Some people have no symptoms. Most cases clear up on their own within a few weeks. Severe cases are treated with antibiotics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old patient, a known case of HIV infection on ART Antiretroviral Therapy. presented with Diarrhea for 3 days. the patient also complained of lower abdominal pain & discomfort. On examination, the patient is conscious & appears to be dehydrated. A routine stool examination was performed which revealed Acid fast oocysts measuring a size of about 5 microns as shown in the image below. which of the following is the causative organism responsible for patient's condition?", "options": [{"label": "A", "text": "Cryptosporidium", "correct": true}, {"label": "B", "text": "Cyclospora", "correct": false}, {"label": "C", "text": "Isospora", "correct": false}, {"label": "D", "text": "Giardia lamblia", "correct": false}], "correct_answer": "A. Cryptosporidium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cryptosporidium Immunocompromised with diarrhea and stool examination showing acid-fast oocysts with the size of 5 microns s/o indicate cryptosporidium species of coccidian parasites.</p>\n<p><strong>Highyeild:</strong></p><p>Cryptosporidium is a microscopic parasite that causes the diarrheal disease cryptosporidiosis. Both the parasite and the disease are commonly known as “Crypto.”</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Cyclospora oocyst is about 10 microns. Sized Oocyst & can cause diarrhea in HIV patients & immunocompromised individuals. Option C. Isospora's oocyst is about 30 microns. Sized Oocyst & can cause diarrhea in HIV patients & immunocompromised individuals. Option D. Giardia Lamblia is not stained by acid-fast stain. It is associated with malabsorption syndromes & chronic diarrhea</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis of cryptosporidiosis is made by examination of stool samples. Because detection of Cryptosporidium can be difficult, patients may be asked to submit several stool samples over several days.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 40year old patient complaining of loose stools for 4 days. patient gives a history of Liver transplant 1 month ago. The patient also complained of lower abdominal pain & discomfort. A routine stool examination was performed which revealed Acid fast oocysts measuring a size of about 10 microns as shown in the image below. which of the following is the causative organism responsible for patient's condition?", "options": [{"label": "A", "text": "Cryptosporidium", "correct": false}, {"label": "B", "text": "Cyclospora", "correct": true}, {"label": "C", "text": "Isospora", "correct": false}, {"label": "D", "text": "Giardia lamblia", "correct": false}], "correct_answer": "B. Cyclospora", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cyclospora Immunocompromised with diarrhea and stool examination showing acid-fast oocysts with a size of 10 microns s/o indicate Cyclospora species of coccidian parasites.</p>\n<p><strong>Highyeild:</strong></p><p>Cyclosporiasis is an intestinal illness caused by the microscopic parasite Cyclospora cayetanensis . People can become infected with Cyclospora by consuming food or water contaminated with the parasite. People living or traveling in countries where cyclosporiasis is endemic may be at increased risk for infection</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. cryptospora oocyst is about 5 microns. Sized Oocyst & can cause diarrhea in HIV patients & immunocompromised individuals. Option C. Isospora's oocyst is about 30 microns. Sized Oocyst & can cause diarrhea in HIV patients & immunocompromised individuals. Option D. Giardia lamblia is not stained by acid-fast. It is associated with malabsorption syndromes & chronic diarrhea.)</p>\n<p><strong>Extraedge:</strong></p><p>Cryptosporidium is resistant to chlorine disinfection so it is tougher to kill than most disease-causing germs. The usual disinfectants, including most commonly used bleach solutions, have little effect on the parasite. An application of hydrogen peroxide seems to work best.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-year-old male complained of diarrhea for 3 days associated with lower abdominal pain & discomfort for 2 days. He is diagnosed case of HIV with pulmonary Tuberculosis on regular treatment. A routine stool examination was performed which revealed Acid fast oocysts measuring a size of about 25 microns as shown in the image below. Which of the following is the causative organism responsible for the patient's condition?", "options": [{"label": "A", "text": "Cryptosporidium", "correct": false}, {"label": "B", "text": "Cyclospora", "correct": false}, {"label": "C", "text": "Isospora", "correct": true}, {"label": "D", "text": "Giardia lamblia", "correct": false}], "correct_answer": "C. Isospora", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Isospora Immunocompromised with diarrhea and stool examination showing acid-fast oocysts with the size of 25 -30 microns s/o indicate Isospora species of coccidian parasites</p>\n<p><strong>Highyeild:</strong></p><p>Isospora is a genus of internal parasites in the subclass Coccidia. It is responsible for the condition isosporiasis, which causes acute, non-bloody diarrhea in immunocompromised individuals.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. cryptospora oocyst is about 5 microns. Sized Oocyst & can cause diarrhea in HIV patients & immunocompromised individuals. Option B. Giardia lamblia is not stained by acid-fast. It is associated with malabsorption syndromes & chronic diarrhea. Option D. immunocompromised with diarrhea and stool examination showing acid-fast oocysts with size of 10 microns s/o Cyclospora.</p>\n<p><strong>Extraedge:</strong></p><p>The causative pathogen of cystoisosporiasis is C belli, a protozoan that belongs to the subclass Coccidia in the phylum Apicomplexa. The mode of transmission of isosporiasis is fecal-oral, ie, through food or water contaminated with human feces.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old patient, known case of HIV infection on ART Antiretroviral Therapy. presented with Diarrhea for 3 days. the patient also complained of lower abdominal pain & discomfort. On examination, the patient is conscious & appears to be dehydrated. A routine stool examination was performed which revealed Acid fast oocysts measuring a size of about 5 microns as shown in the image below. Which of the following drug is used for appropriate management of patient condition?", "options": [{"label": "A", "text": "L-AMB Lentigines, Atrial myxomas, Mucocutaneous myxomas, and Blue nevi", "correct": false}, {"label": "B", "text": "Nitazoxanide furoate", "correct": true}, {"label": "C", "text": "Paromomycin", "correct": false}, {"label": "D", "text": "Metronidazole", "correct": false}], "correct_answer": "B. Nitazoxanide furoate", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nitazoxanide furoate HIV patient with diarrhea and stool examination showing acid-fast oocysts measuring a size of about 5microns suggestive of cryptosporidiosis.doc for cryptosporidiosis is nitazoxanide furoate.</p>\n<p><strong>Highyeild:</strong></p><p>CD4 Count Types of Germs Any CD4 count Salmonella, Campylobacter, Tuberculosis, C. difficile, Giardia, Entamoeba, Strongyloides <200 cells/mm³ Cryptosporidium <150 cells/mm³ Histoplasma <100 cells/mm³ Isospora, Microsporidia <50 cells/mm³ MAC, CMV</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, C, and D. All others are not useful in cryptosporidiosis.</p>\n<p><strong>Extraedge:</strong></p><p>belli are large (25 to 30 µm) and have a typical ellipsoidal shape. When excreted, they are immature and contain one sporoblast. The oocyst matures after excretion: the single sporoblast divides in two sporoblasts, which develop cyst walls, becoming sporocysts, which eventually contain four sporozoites each.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 40year old patient complaining of loose stools for 4 days. patient gives a history of Liver transplant 1 month ago. The patient also complained of lower abdominal pain & discomfort. A routine stool examination was performed which revealed Acid fast oocysts measuring a size of about 10 microns microns as shown in the image below. which of the following drug is used for appropriate management of patient condition?", "options": [{"label": "A", "text": "L-AMB Lentigines, Atrial myxomas, Mucocutaneous myxomas, and Blue nevi", "correct": false}, {"label": "B", "text": "Nitazoxanide furoate", "correct": false}, {"label": "C", "text": "Cotrimoxazole", "correct": true}, {"label": "D", "text": "Metronidazole", "correct": false}], "correct_answer": "C. Cotrimoxazole", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cotrimoxazole HIV patient with diarrhea and stool examination showing acid-fast oocysts measuring a size of about 10 microns suggestive of cyclosporidiosis.doc for cyclosporidiosis is cotrimoxazole.</p>\n<p><strong>Highyeild:</strong></p><p>CD4 Count Types of Germs Any CD4 count Salmonella, Campylobacter, Tuberculosis, C. difficile, Giardia, Entamoeba, Strongyloides <200 cells/mm³ Cryptosporidium <150 cells/mm³ Histoplasma <100 cells/mm³ Isospora, Microsporidia <50 cells/mm³ MAC, CMV</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, and D. All others are not useful in cyclosporidiosis isosporidiosis.</p>\n<p><strong>Extraedge:</strong></p><p>Human intestinal isosporiasis is caused by Isospora belli. Symptoms of I. belli infection in immunocompetent patients include diarrhea, steatorrhea, headache, fever, malaise, abdominal pain, vomiting, dehydration, and weight loss, blood is not usually present in the feces.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The protozoan causing dysenteric symptoms which belong to ciliates:", "options": [{"label": "A", "text": "Balantidium coli", "correct": true}, {"label": "B", "text": "Entamoeba coli", "correct": false}, {"label": "C", "text": "Giardia", "correct": false}, {"label": "D", "text": "Trichomonas", "correct": false}], "correct_answer": "A. Balantidium coli", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Balantidium coli Balantidium coli is a parasitic species of ciliate alveolates that causes the disease balantidiasis. It is the only member of the ciliate phylum known to be pathogenic to humans. Balantidium coli is an intestinal protozoan parasite that causes the infection called balantidiasis.</p>\n<p><strong>Highyeild:</strong></p><p>Humans and other mammals can become infected with Balantidium coli by ingesting infective cysts from food and water that is contaminated by feces. Balantidium coli (B. coli), the largest protozoon affecting humans, is a ciliate organism often associated with pigs. The greenish-yellow trophozoites are capable of attacking the intestinal epithelium, creating ulcers and causing bloody diarrhea similar to that of amebic dysentery. Balantidium coli causes Balantidiasis or Balantidial dysentery. It is a parasite that exists in two forms cysts and trophozoites.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Entamoeba coli is a non-pathogenic species of entamoeba that frequently exists as a commensal parasite in the human GI tract. It may lead to gastritis, dyspepsia, hyperacidity, and indigestion. Option C. Giardia lamblia is the causative agent of giardiasis and is the only common protozoan found in the duodenum and jejunum of humans. Symptoms are malaise, weakness, weight loss, and abdominal cramps. Stools may be watery, semi-solid, greasy, bulky, and foul-smelling. Option D. vaginalis is sexually transmitted, and most infections are asymptomatic or mild in both men and women. In women the infection is normally limited to the vulva, vagina, and cervix; it does not usually extend to the uterus.</p>\n<p><strong>Extraedge:</strong></p><p>Balantidium coli has two developmental stages, a trophozoite stage and a cyst stage. In trophozoites, the two nuclei are visible. The macronucleus is long and sausage-shaped, and the spherical micronucleus is nested next to it, often hidden by the macronucleus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about B coli except", "options": [{"label": "A", "text": "It is a protozoan", "correct": false}, {"label": "B", "text": "Cyst is the infective stage", "correct": false}, {"label": "C", "text": "Usually invades liver", "correct": true}, {"label": "D", "text": "It is the largest protozoan parasite inhabiting the large intestine in man", "correct": false}], "correct_answer": "C. Usually invades liver", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Usually invades liver Balantidium coli is an intestinal protozoan parasite that causes the infection called balantidiasis. Humans and other mammals can become infected with Balantidium coli by ingesting infective cysts from food and water that is contaminated by feces.</p>\n<p><strong>Highyeild:</strong></p><p>Balantidiasis is caused by contamination and transmitted through the fecal-oral route. Balantidium coli primarily is found in the lumen of the large intestines. It can penetrate into the mucosa layer of the large intestine and start to cause ulcers. The cyst is the infective stage of the Balantium coli life cycle. Once the cyst is ingested via feces-contaminated food or water, it passes through the host digestive system.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Balantidium coli is a parasitic species of ciliate alveolates that causes balantiiasis. Option B. Infection occurs when the cyst is ingested by the host which usually happens due to the consumption of contaminated water. Option D. B. coli lives in the cecum and colon of humans, pigs, rats, and other mammals. It is the largest known protozoan parasite to infect human beings. It is transmitted by fecal-oral route.</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis is based on detection of trophozoites in stool samples from symptomatic patients or in tissue collected during endoscopy. Cysts are less frequently encountered, and are most likely to be recovered from formed stool. Balantidium coli is passed intermittently and once outside the colon is rapidly destroyed</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Maltese cross is associated with:", "options": [{"label": "A", "text": "Candida albicans", "correct": false}, {"label": "B", "text": "Penicillium Marneffei", "correct": false}, {"label": "C", "text": "Babesia microti", "correct": true}, {"label": "D", "text": "Cryptococcus", "correct": false}], "correct_answer": "C. Babesia microti", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Babesia microti Occasional classic tetrad forms Maltese Cross or extracellular rings can be present. Rings of Babesia sp . in thick blood smears. Thin, delicate rings of Babesia sp. So-called \"Maltese cross formations\" on the blood film are diagnostic (pathognomonic) of babesiosis.</p>\n<p><strong>Highyeild:</strong></p><p>Round particles producing birefringent Maltese crosses under polarized light are commonly seen in the urinary sediment of patients with a nephrotic syndrome Fabry’s disease. The appearance of the Maltese crosses is due to the birefringence of lipid droplets, which consist mainly of cholesterol esters.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, and D. Maltese cross is not seen in infections caused by these micro-organisms.</p>\n<p><strong>Extraedge:</strong></p><p>Clinical Presentation. Most infections are probably asymptomatic, as indicated by serologic surveys. Manifestations of disease include fever, chills, sweating, myalgias, fatigue, hepatosplenomegaly, and hemolytic anemia. Symptoms typically occur after an incubation period of 1 to 4 weeks, and can last several weeks.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "HIV Patient complaining of persistent diarrhea shows acid fast cyst in stool. What is the possible organism?", "options": [{"label": "A", "text": "Microsporidium Trichomonas Vaginalis", "correct": false}, {"label": "B", "text": "Entamoeba histolytica", "correct": false}, {"label": "C", "text": "Giardiasis", "correct": false}, {"label": "D", "text": "Isospora", "correct": true}], "correct_answer": "D. Isospora", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Isospora Isospora belli is a coccidian, unicellular protozoan parasite that resides in the gastrointestinal tract. It usually causes non-bloody diarrhea in tropical and subtropical climates. In developed countries, it is found in recent immigrants, travelers returning from endemic regions, and patients with AIDS.</p>\n<p><strong>Highyeild:</strong></p><p>In patients with AIDS, or other immune compromised hosts, infection is often severe with a fluid, secretory-like, diarrhea that may lead to dehydration. It is estimated that diarrhea occurs in roughly 90% of HIV/AIDS patients in developing countries, and 30–60% in developed countries due to this microorganism.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, and C. These are not the opportunistic infections causing diarrhea in HIV/AIDS patients Option A. Trichomonas Vaginalis - vaginal flagellate- cause Trichomoniasis. Option B. Entamoeba histolytica - causes diarrhea but is not acid-fast. Option C. Giardiasis - causes diarrhea but is not acid-fast.</p>\n<p><strong>Extraedge:</strong></p><p>Cystoisosporiasis (formerly known as isosporiasis) is an intestinal disease of humans caused by the coccidian parasite Cystoisospora belli (formerly known as Isospora belli). Cystoisosporiasis is most common in tropical and subtropical areas of the world.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The infective form of Entamoeba histolytica is:", "options": [{"label": "A", "text": "Uninucleate cyst", "correct": false}, {"label": "B", "text": "Trophozoite", "correct": false}, {"label": "C", "text": "Quadrinucleate cyst", "correct": true}, {"label": "D", "text": "Binucleate cyst", "correct": false}], "correct_answer": "C. Quadrinucleate cyst", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Quadrinucleate cyst Quadri or tetranuclear cyst is the infective stage of E. Histolytica. The cysts can survive for weeks or months in wet environments, though are easily killed by heat or freezing temperatures.</p>\n<p><strong>Highyeild:</strong></p><p>Quadri or tetranuclear cyst is the infective stage of E. Histolytica. When the cysts are ingested the cyst extrudes a trophozoite with four nuclei. This divides into four trophozoites, and the nuclei of each of these divide to lead to eight initial trophozoites.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, and D. These are not the correct options as explained in the diagram below</p>\n<p><strong>Extraedge:</strong></p><p>Amebiasis is an intestinal (bowel) illness caused by a microscopic (tiny) parasite called Entamoeba histolytica, which is spread through human feces (poop). Often there are no symptoms, but, sometimes it causes diarrhea (loose stool/poop), nausea (a feeling of sickness in the stomach), and weight loss.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Regarding the trophozoite of E. Histolytica which statement is true:", "options": [{"label": "A", "text": "It is usually larger than that of E.coli", "correct": false}, {"label": "B", "text": "Nuclear membrane is lined with coarse granules of chromatin", "correct": false}, {"label": "C", "text": "Red blood cells are always present", "correct": false}, {"label": "D", "text": "Ectoplasmic pseudopodia are extended rapidly", "correct": true}], "correct_answer": "D. Ectoplasmic pseudopodia are extended rapidly", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ectoplasmic pseudopodia are extended rapidly Cytoplasm is divided into endoplasm and ectoplasm. Pseudopodia arise from ectoplasm.</p>\n<p><strong>Highyeild:</strong></p><p>Functions of pseudopodia: Locomotion. In capturing food.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It is usually smaller than that of E.coli. Option B. Nuclear membrane is thin and lined with fine granules of chromatin. Option C. Granular endoplasm looks like a ground glass appearance and contains red blood cells (RBCs), white blood cells (WBCs), and food vacuoles containing tissue debris and bacteria. RBCs are found only in the stage of invasion.</p>\n<p><strong>Extraedge:</strong></p><p>Metronidazole is currently the standard therapy for treating adults and children with invasive amoebiasis, but it may not be sufficient to eliminate amoebic cysts from the intestine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Cyst of Entamoeba histolytica contain how many nuclei?", "options": [{"label": "A", "text": "1-2", "correct": false}, {"label": "B", "text": "1-4", "correct": true}, {"label": "C", "text": "1-6", "correct": false}, {"label": "D", "text": "1-8", "correct": false}], "correct_answer": "B. 1-4", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1-4 Cyst of E. histolytica contains 1-4 nuclei. It Quadrinucleate cyst is the infectious form of Entamoeba histolytica. It is 10-15 microns. Spherical and quadrinucleate. Thick chitinous wall which makes it resistant to gastric acid and chlorine in water. Uninucleate and binucleate have a glycogen mass (stains brown with iodine) and 1-4 chromatoid bars (stains black with iron-hematoxylin).</p>\n<p><strong>Highyeild:</strong></p><p>Entamoeba histolytica is a parasitic amoeba that has an environmentally resistant infectious stage, known as a cyst. In the intestine, cysts undergo excystation, and the intestinal stage, known as a trophozoite, is released and begins to multiply asexually.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, C, and D. Incorrect as the Cyst of E. histolytica contains 1-4 nuclei.</p>\n<p><strong>Extraedge:</strong></p><p>Entamoeba histolytica is a parasitic amoeba belonging to the phylum Sarcomastigophora, which has an environmentally resistant infectious stage, known as a cyst. In the intestine, cysts undergo excystation, and the intestinal stage, known as a trophozoite, is released and begins to multiply asexually.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pseudopodia is a mode of locomotion in:", "options": [{"label": "A", "text": "Entamoeba histolytica", "correct": true}, {"label": "B", "text": "Candida", "correct": false}, {"label": "C", "text": "Mycoplasma", "correct": false}, {"label": "D", "text": "Treponema pallidum", "correct": false}], "correct_answer": "A. Entamoeba histolytica", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Entamoeba histolytica Pseudopodia are found in E. histolytica. Other protozoa pathogenic to humans which are motile by protozoa are Acanthamoeba and Naegleria.</p>\n<p><strong>Highyeild:</strong></p><p>Functions of pseudopodia: Locomotion. In capturing food.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Candida is a non-motile yeast-like fungus. Option C. Mycoplasma has gliding motility but has no special organ of motility. Option D. Treponema pallidum is a bacterium motile by flagella on the poles.</p>\n<p><strong>Extraedge:</strong></p><p>Entamoeba histolytica is a parasitic amoeba belonging to the phylum Sarcomastigophora, which has an environmentally resistant infectious stage, known as a cyst. In the intestine, cysts undergo excystation, and the intestinal stage, known as a trophozoite, is released and begins to multiply asexually.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A mother takes her 4-year-old child to a daycare center. She has noticed that the child’s frequent stools are non-bloody, foul-smelling, and fatty. The child has no fever. A parasite infection is suspected. What attribute of this parasite imparts its pathogenicity?", "options": [{"label": "A", "text": "Lytic enzymes BinucleateCyst", "correct": false}, {"label": "B", "text": "Flagella", "correct": false}, {"label": "C", "text": "Ventral sucking disc", "correct": true}, {"label": "D", "text": "Encystment", "correct": false}], "correct_answer": "C. Ventral sucking disc", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ventral sucking disc This is the history of giardiasis. The important part of the parasite responsible for clinical manifestation is ventral sucking disc by which the parasite attaches to the intestinal epithelium.</p>\n<p><strong>Highyeild:</strong></p><p>Giardia exists in two forms cyst and trophozoite. The infective stage is the cyst. Infection is acquired by the fecal-oral route. Diagnosis is established by stool examination for the cyst and the trophozoites.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Malabsorption of various types occurs i.e. steatorrhoea, proteins & vitamins. Also, disaccharidase deficiency leads to lactose intolerance. Option B. Flagella is organelle of locomotion. Option D. Encystment is important as a survival mechanism in the environment.</p>\n<p><strong>Extraedge:</strong></p><p>Giardiasis spreads through contaminated food or water or by person-to-person contact. It's most common in areas with poor sanitation and unsafe water. Symptoms might include watery diarrhoea alternating with greasy stools. Fatigue, cramps and belching wind may also occur. Some people have no symptoms. Most cases clear up on their own within a few weeks.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient presents with diarrhea. Analysis of stool on a wet mount shows mobile protozoa without RBCs and pus cells. The Diagnosis is", "options": [{"label": "A", "text": "Balantidium coli", "correct": false}, {"label": "B", "text": "Giardiasis", "correct": true}, {"label": "C", "text": "Trichomonas hominis", "correct": false}, {"label": "D", "text": "Entamoeba histolytica", "correct": false}], "correct_answer": "B. Giardiasis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Giardiasis Giardiasis is associated with diarrhea, steatorrhoea, and malabsorption syndrome. This infection is not associated with dysentery.</p>\n<p><strong>Highyeild:</strong></p><p>Giardia exists in two forms cyst and trophozoite. The infective stage is the cyst. Infection is acquired by the fecal-oral Diagnosis is established by stool examination for the cyst and the trophozoites.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Balantidium coli is a ciliate protozoan that causes ciliate dysentery with RBCs and pus cells in stools. Option C. Trichomonas hominis is a non-pathogenic flagellate protozoan present as a normal commensal in the GIT. Option D. Entamoeba histolytica causes amoebic dysentery with RBCs and pus cells in stools.</p>\n<p><strong>Extraedge:</strong></p><p>Giardia infection (giardiasis) can cause a variety of intestinal symptoms, which include: Diarrhea Gas Foul-smelling, greasy poop that can float. Stomach cramps or pain. Upset stomach or nausea. Dehydration.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Following is true about Giardia lamblia:", "options": [{"label": "A", "text": "Is the only flagellate parasite without a cystic stage", "correct": false}, {"label": "B", "text": "Infection occurs by ingestion of trophozoite in food or water", "correct": false}, {"label": "C", "text": "Is the only protozoan parasite found in the lumen of the small intestine", "correct": true}, {"label": "D", "text": "It May sometimes invade the bloodstream and cause ectopic lesions", "correct": false}], "correct_answer": "C. Is the only protozoan parasite found in the lumen of the small intestine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Is the only protozoan parasite found in the lumen of the small intestine Giardia is the only protozoan parasite found in the lumen of the small intestine.</p>\n<p><strong>Highyeild:</strong></p><p>Giardia exists in two forms cyst and trophozoite. The infective stage is the cyst. Infection is acquired by the fecal-oral Diagnosis is established by stool examination for the cyst and the trophozoites</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Trichomonas is a flagellate parasite without a cystic stage. Option B. Infection occurs by ingestion of quarinucleate cyst in food or water. Option D. Giardia trophozoites do not invade mucosa, but feed on mucous secretions. in the GIT.</p>\n<p><strong>Extraedge:</strong></p><p>Microscopy with direct fluorescent antibody testing (DFA) is considered the test of choice for diagnosis of giardiasis since it provides increased sensitivity over non-fluorescent microscopy techniques. Other alternate methods for detection include: Rapid immunochromatographic cartridge assays.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about Giardia:", "options": [{"label": "A", "text": "Malabsorption is seen", "correct": false}, {"label": "B", "text": "Diarrhea has seen", "correct": false}, {"label": "C", "text": "Trophozoite is binucleate", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above Malabsorption is seen in a few cases. Most patients are asymptomatic Most common presentation is diarrhea with abdominal pain. The gold standard for diagnosis is stool examination for trophozoite and cyst.</p>\n<p><strong>Highyeild:</strong></p><p>GIARDIA INTESTINALIS/LAMBLIA Habitat: duodenum & upper jejunum Option C. Trophozoite: vegetative stage, pear-shaped (monkey-faced appearance), 10-20x6-15mm, convex dorsal surface, 2 axostyles, 2 nuclei, four pairs of flagella. Multiply by binary fission, motile (falling leaf motility) Cyst: oval, 8-14x6-10mm, four nuclei, axostyle Source of infection: humans, the infective stage is a cyst, through contaminated food & water Life cycle: excystation in the duodenum, trophozoites attach to the intestinal villi & multiply by binary fission Option A and B. Clinical features: asymptomatic mostly, diarrhea with abdominal pain, malabsorption syndrome. Option D. Laboratory diagnosis: Faecal examination: cysts & trophozoites Duodenal aspirate: trophoziotes (enterotest) Duodenal or jejunal biopsy Antigen detection in stool: ELISA, Counter Immune-Electro-Osmophoresis CIEP, immunofluorescence. Treatment-Metronidazole or Tinidazole</p>\n<p><strong>Extraedge:</strong></p><p>Microscopy with direct fluorescent antibody testing (DFA) is considered the test of choice for diagnosis of giardiasis since it provides increased sensitivity over non-fluorescent microscopy techniques. Other alternate methods for detection include: Rapid immunochromatographic cartridge assays.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The egg of which of the following parasites consists of polar filaments arising from either end of the embryo here;", "options": [{"label": "A", "text": "Taenia saginata", "correct": false}, {"label": "B", "text": "Taenia solium", "correct": false}, {"label": "C", "text": "Echinococcus granulosus", "correct": false}, {"label": "D", "text": "Hymenolepis nana", "correct": true}], "correct_answer": "D. Hymenolepis nana", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hymenolepis nana nana is the smallest cestode infecting man and also known as the dwarf tapeworm. It is the only cestode that can complete its life cycle in one host. The eggs are spherical or oval having two distinct membranes-outer membrane and inner embryophore. Two polar filaments arise from either end of the embryo here.</p>\n<p><strong>Highyeild:</strong></p><p>Ingestion of parasite eggs on fecally contaminated food or fomites allows the initial infection. Once in the intestine, the eggs hatch to form oncospheres , which penetrate the mucosa to encyst as cysticercoid Four or 5 days later, the larval cyst ruptures into the lumen to form the relatively small, adult H. nana tapeworm (15 to 50 mm in length). Internal autoinfection may occur as parasite eggs are released from gravid proglottids in the ileum. In addition, poor sanitary practices promote external (fecal-oral) autoinfection as well as transmission to others sharing the same living quarters</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B, and C. Polar filaments arising from either end of the embryophore are not seen. Option A and B. Radially striated inner embryophore present. Option C. Oncosphere present.</p>\n<p><strong>Extraedge:</strong></p><p>'</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 41 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 79-year-old woman is brought to the emergency department from the nursing home due to explosive diarrhea. Laboratory studies show leukocytosis and results from a stool specimen return positive for Clostridium difficile toxin genes by polymerase chain reaction. Three days later, one of the nurses who cared for the patient at the nursing home is admitted with diarrhea and is found to have C difficile infection. However, the other nurses who also took care of the patient are asymptomatic and do not develop the infection. If all the nurses were similarly exposed to C difficile, which of the following is the most likely reason that the asymptomatic nurses did not develop the infection?", "options": [{"label": "A", "text": "Adequate pancreatic enzyme secretion", "correct": false}, {"label": "B", "text": "Intact cell-mediated immunity", "correct": false}, {"label": "C", "text": "Preformed anti-spore immunoglobulins", "correct": false}, {"label": "D", "text": "Preserved intestinal microbiome", "correct": true}], "correct_answer": "D. Preserved intestinal microbiome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Preserved intestinal microbiome Over 400 types of bacteria inhabit the healthy human gastrointestinal tract as part of the normal intestinal microbiome. In healthy humans, these include very few aerobes (e.g., Pseudomonas), approximately 10% facultative anaerobes (e.g., Escherichia coli, Klebsiella, Lactobacillus, Bacillus), and a majority of strict anaerobes (e.g., Bacteroides, Fusobacterium, Clostridium). These intestinal bacteria effectively suppress the overgrowth of Clostridium difficile and other potentially pathogenic bacteria by competing for nutrients and adhesion sites within the gut.</p>\n<p><strong>Highyeild:</strong></p><p>Antibiotic therapy is the most important risk factor for C difficile infection (CDI) as it can alter the microbiome, leading to a potential overgrowth of pathogenic strains and clinical disease. The organism causes disease by releasing 2 toxins that damage the mucosal lining of the large intestine, leading to diarrhea (toxin A) and necrosis (toxin B) with pseudo-membrane formation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Increased risk of CDI is seen with proton pump inhibitor use, suggesting that gastric acidity may have a protective role. The pancreas secretes protease, amylase and lipase, and trypsinogen, among others; however, there is no association between pancreatic enzyme secretion and CDI. Option: B. Cell-mediated immunity is not essential for the prevention of CDI, but it is required to eradicate infections with intracellular agents that avoid the humoral (antibody} immune response (eg, Legionella, Neisseria gonorrhoeae, Listeria monocytogenes, viruses, Leishmania). Option: C. Individuals usually develop serum antibodies against C difficile toxins, not spores.</p>\n<p><strong>Extraedge:</strong></p><p>Clostridium difficile colitis results from disruption of normal, healthy bacteria in the colon, often as a result of antibiotics. C. difficile can also be transmitted from person to person by spores. It can cause severe damage to the colon and even be fatal. Symptoms include diarrhoea, stomach pain and fever. Treatment includes antibiotics. Even when treated with antibiotics, the infection may come back. In rare cases, faecal transplant or surgery may be needed.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 65-year-old man comes to the office due to pain, redness, and swelling in his right calf. The patient is diagnosed with cellulitis and is started on clindamycin. A few days after starting treatment, he develops watery diarrhea and abdominal cramps. The patient is hospitalized, and a complete blood count reveals leukocytosis. Is the toxin responsible for his current condition most directly impairs which of the following components of intestinal mucosal cells?", "options": [{"label": "A", "text": "Apical ion transport", "correct": false}, {"label": "B", "text": "Cell membrane integrity", "correct": false}, {"label": "C", "text": "Cytoskeleton integrity", "correct": true}, {"label": "D", "text": "Mitochondrial energy production", "correct": false}], "correct_answer": "C. Cytoskeleton integrity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cytoskeleton integrity Clostridioides (formerly Clostridium) difficile is part of the gut's normal microbial flora in 2%-3°/o of healthy adults and approximately 70% of healthy infants. Administration of antibiotics (eg, clindamycin, fluoroquinolones, and broad-spectrum penicillin) that are lethal to other commensal gut organisms can result in C. difficile colitis due to unchecked replication of pathogenic strains of C. difficile.</p>\n<p><strong>Highyeild:</strong></p><p>C. difficile strains produce toxin A and toxin B, which act synergistically, although toxin B is significantly more virulent. The toxins bind specific receptors on intestinal mucosal cells and are internalized, allowing them to inactivate Rho-regulatory proteins involved in actin cytoskeletal structure maintenance. The result is loss of cytoskeleton integrity, leading to cell rounding/retraction, disruption of intercellular tight junctions, and increased paracellular intestinal fluid secretion (e.g., watery diarrhea). Both toxins also have inflammatory effects (e.g., neutrophil recruitment) and can induce apoptosis, resulting in pain and pseudo-membrane formation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Apical ion transport is most directly affected by the cholera toxin (main exotoxin of Vibrio cholerae) through activation of adenylate cyclase, which leads to decreased salt reabsorption and increased transport of sodium and chloride out of the gut mucosal cell. Apical ion transporters can be indirectly affected by C. difficile toxins due to loss of cell polarity (secondary to cytoskeletal dysfunction). Option: B. Loss of cell membrane integrity is characteristic of alpha toxin lecithinase, one of many exotoxins released by Clostridium perfringens. C. perfringens can cause transient watery diarrhea. However, it is most frequently associated with clostridial myonecrosis (ie, gas gangrene), a rapidly progressive form of fasciitis associated with penetrating injury by soil-contaminated objects. Option: D. Mitochondria are the primary source of ATP in human cells. Cyanide and nucleoside reverse transcriptase inhibitors are examples of drugs associated with mitochondrial toxicity.</p>\n<p><strong>Extraedge:</strong></p><p>Clostridium is a genus of anaerobic, Gram-positive bacteria. Species of Clostridium inhabit soils and the intestinal tract of animals, including humans. This genus includes several significant human pathogens, including the causative agents of botulism and tetanus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 46-year-old HIV-positive man is hospitalized with fever, cramping abdominal pain, and watery diarrhea. The evaluation shows high fever, hypotension, tachycardia, and lower abdominal distension and tenderness. Abdominal x-ray reveals free intraperitoneal air, and the patient is taken for urgent exploratory laparotomy. Operative findings include an erythematous and dilated colon. A focus of bowel wall necrosis with perforation is resected. Histopathology reveals acute inflammatory changes and epithelial necrosis as shown below . Which organism is likely involved in this condition?", "options": [{"label": "A", "text": "Campylobacter jejuni", "correct": false}, {"label": "B", "text": "Clostridium difficile", "correct": true}, {"label": "C", "text": "Salmonella typhi", "correct": false}, {"label": "D", "text": "Shigella flexneri", "correct": false}], "correct_answer": "B. Clostridium difficile", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687507110585-QTDV023003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium difficile This patient with diarrhea, abdominal pain, and fever developed a colonic perforation. In conjunction with the pseudo-membrane demonstrated on histology, this presentation is highly suggestive of Clostridium difficile infection (CDI).</p>\n<p><strong>Highyeild:</strong></p><p>C difficile is an anaerobic, spore-forming, toxigenic, gram-positive rod that causes infectious colitis. The most significant risk factor for the development of CDI is antibiotic use. Antibiotics (particularly clindamycin, fluoroquinolones, and cephalosporins) alter the normal bowel flora, thereby predisposing to C difficile overgrowth. Other risk factors include hospitalization, older age, and proton pump inhibitor use. C difficile produces 2 toxins: Toxin A (enterotoxin) and Toxin B (cytotoxin). These toxins disrupt cellular cytoskeletons and intercellular tight junctions, leading to colonocyte apoptosis. The colonic mucosa responds to toxin exposure by forming a white, patchy pseudo-membrane, which consists of a neutrophil-predominant inflammatory infiltrate, fibrin, bacteria, and necrotic epithelium. Patients with severe disease may develop a nonobstructive colonic dilation known as toxic megacolon, which leads to an increased risk of colonic perforation (as seen in this patient).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Campylobacter jejuni is associated with watery diarrhea that may become bloody, abdominal cramping, and fever. Neutrophilic infiltrate and crypt abscesses are identified on histology. Option: C. Salmonella typhi causes typhoid fever, which manifests with bloody diarrhea, abdominal pain, high fever, and salmon-colored macules located mainly on the trunk. Histology demonstrates a lymphoplasmacytic inflammatory infiltrate and associated hemorrhage. Option: D. Shigella flexneri infection is characterized by sudden onset of severe abdominal cramping, bloody diarrhea, vomiting, and high fever. Cryptitis, ulcerations, and crypt abscesses are identified on histology.</p>\n<p><strong>Extraedge:</strong></p><p>Clostridium difficile colitis results from disruption of normal, healthy bacteria in the colon, often as a result of antibiotics. C. difficile can also be transmitted from person to person by spores. It can cause severe damage to the colon and even be fatal. Symptoms include diarrhoea, stomach pain and fever. Treatment includes antibiotics. Even when treated with antibiotics, the infection may come back. In rare cases, faecal transplant or surgery may be needed.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 70-year-old man is hospitalized due to abrupt-onset, severe left thigh pain with no preceding trauma. Temperature is 38.9 C (102 F), blood pressure is 90/60 mm Hg, pulse is 120/min, and respirations are 24/min. Left thigh examination shows diffuse swelling with dusky skin discoloration and several bullae filled with hemorrhagic fluid. There is significant tenderness and crepitus on palpation. Gram staining of the bullae fluid reveals numerous gram-positive rods and subsequent culture grows Clostridium septicum. Which of the following is the greatest risk factor for this patient's current condition?", "options": [{"label": "A", "text": "Colonic malignancy", "correct": true}, {"label": "B", "text": "Hemochromatosis", "correct": false}, {"label": "C", "text": "indwelling vascular catheter", "correct": false}, {"label": "D", "text": "Multiple myeloma", "correct": false}], "correct_answer": "A. Colonic malignancy", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Colonic malignancy Clostridium septicum is a spore-forming, exotoxin-producing, gram-positive bacterium that is a normal commensal of the gastrointestinal tract in humans.</p>\n<p><strong>Highyeild:</strong></p><p>Clostridium septicum is largely non-pathogenic, breakdowns in the gastrointestinal mucosa can lead to invasion with subsequent hematogenous dissemination to healthy muscle tissue, resulting in spontaneous gas gangrene (non-traumatic). Manifestations include rapid onset muscle pain, fever, hemorrhagic bullae with the dusky surrounding skin, and tissue edema/crepitus. Urgent antibiotics and surgery are required, as the infection is often fatal even with early treatment. Most cases of spontaneous gas gangrene are triggered by an underlying colonic malignancy, which creates a portal of entry for the bacteria. Inflammatory bowel disease and immunosuppression are also risk factors. Unlike C. septicum gas gangrene, C perfringens gas gangrene is usually associated with preceding trauma.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Patients with hemochromatosis are at increased risk for fulminant Vibrio vulnificus infections (the organism is dependent on free iron for growth). Although vulnificus can cause rapid-onset sepsis and bullous skin lesions, it is a gram-negative bacterium. In addition, most infections occur due to shellfish consumption or wound contamination with seawater. Option: C. Indwelling vascular catheters increase the risk for candidemia, which can cause sepsis, abscesses, and pustular skin lesions on an erythematous base. Option: D. Multiple myeloma impairs lymphocyte function and reduces the ability of plasma cells to generate normal immunoglobulin, which increases the risk of infection. Pneumonia due to Streptococcus pneumoniae and Haemophilus influenzae and urinary infections due to Escherichia coli are the most common.</p>\n<p><strong>Extraedge:</strong></p><p>Clostridium difficile colitis results from disruption of normal, healthy bacteria in the colon, often as a result of antibiotics. C. difficile can also be transmitted from person to person by spores. It can cause severe damage to the colon and even be fatal. Symptoms include diarrhoea, stomach pain and fever. Treatment includes antibiotics. Even when treated with antibiotics, the infection may come back. In rare cases, faecal transplant or surgery may be needed.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An epidemiologic study is conducted after a sudden increase in the rate of severe postoperative infections in a rural hospital. It is determined that all the patients who developed the infection were operated on with surgical instruments sterilized by a specific autoclave machine. The machine was found to be inadequately sterilizing the equipment due to a malfunction limiting the temperature to 100 C (212 F) during the 15-minute cycle. These patients most likely developed an infection from which of the following bacteria?", "options": [{"label": "A", "text": "Brucella melitensis", "correct": false}, {"label": "B", "text": "Clostridium perfringens", "correct": true}, {"label": "C", "text": "Escherichia coli", "correct": false}, {"label": "D", "text": "Listeria monocytogenes", "correct": false}], "correct_answer": "B. Clostridium perfringens", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium perfringens Autoclave machines are pressure cookers that use heated steam at temperatures of 134 C (273.2 F) to rapidly destroy pathogenic bacteria, fungi, viruses, and spores. Lower temperatures are often associated with inadequate sterilization due to the presence of spore-forming bacteria, which can survive at temperatures past the boiling point of water (100 C [212 FI). Bacterial spores are often found in soil and water and are resistant to chemical disinfectants, irradiation, desiccation, and temperatures as high as 120 C (248 F). Bacillus (eg, Bacillus anthracis) and Clostridium (eg, Clostridium perfringens, C botulinum) species are among the most common spore-forming pathogenic bacteria.</p>\n<p><strong>Highyeild:</strong></p><p>1.Clostridium perfringens (Cl.welchii) Morphology -Large Gram-positive bacilli with straight, parallel sides & slightly rounded ends. -Measure 4-6x1um in size,occuring singly or in chains -Pleomorphic,capsulated & non-motile. -Spores are central or sub terminal. Spores are rarely seen in culture media or material from pathogenic lesions, a characteristic morphologic feature</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. These organisms do not form spores; vegetative bacteria are usually destroyed by temperatures > 70 C (158 F).</p>\n<p><strong>Extraedge:</strong></p><p>GENERAL CHARACTERISTICS Gram-positive rods (at least early in growth), in singles, pairs, or chains. Most are obligate anaerobes, but some microaerophiles. are Produces endospores , but not aerobically; spore shape and position are variable, but usually distend the cell Most are catalase-negative and oxidase negative. Most are isolated from soil, sewage, or marine sediments. Key pathogens are C. tetani (tetanus). C. botulinum (botulism). C. perfringens (food poisoning and gas gangrene), and C. difficile (pseudomembranous colitis).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-day-old boy is brought to the emergency department for inability to feed for 12 hours. His parents report that the infant has been unable to open his mouth and has held his hands clenched all day. The infant was delivered at home by the grandmother. The mother had no access to prenatal care but says that the pregnancy was uncomplicated. Physical examination shows increased muscle tone throughout, arching of the back, and dorsiflexed feet. The umbilical cord is covered with a clump of soil. The mother says that it is customary in her village where she grew up to cover the umbilical stump with dung to speed cord separation. In addition to hygienic umbilical cord care, which of the following is the most effective strategy to prevent this condition?", "options": [{"label": "A", "text": "Early postpartum breastfeeding", "correct": false}, {"label": "B", "text": "Prophylactic antibiotics", "correct": false}, {"label": "C", "text": "Vaccination of pregnant women", "correct": true}, {"label": "D", "text": "Vaccination of infants at birth", "correct": false}], "correct_answer": "C. Vaccination of pregnant women", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vaccination of pregnant women Neonatal tetanus (tetanus neonatorum) is a major cause of infant mortality in developing countries. Neonatal tetanus results from the introduction of Clostridium tetani spores to the infant, generally from unhygienic deliveries or cord care. Symptoms typically begin 5-7 days after birth and can progress more rapidly than in adults.</p>\n<p><strong>Highyeild:</strong></p><p>Neonatal tetanus Infected infants become irritable and have difficulty feeding and suckling due to tonic spasms of the masticatory muscles (trismus). As the disease progresses, spasms and hypertonicity become more generalized. Mortality approaches 100% without treatment. Prevention of neonatal tetanus focuses on vaccinating women who are pregnant or may become pregnant with inactivated tetanus toxin (tetanus toxoid). Appropriately vaccinated women provide transplacental IgG to the fetus, which decreases the incidence of neonatal tetanus by approximately 95%.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Secretory IgA found in breast milk helps prevent respiratory and gastrointestinal infections in the newborn by providing mucosal immune support. However, adequate protection against neonatal tetanus requires the presence of toxin-neutralizing, circulating IgG antibodies that are obtained trans-placentally. Option: B. Treatment of tetanus, including neonatal tetanus, involves the use of antibiotics to kill C tetani and the administration of tetanus immune globulin to neutralize unbound toxins. However, these agents are not used for tetanus prevention. Option: D. Tetanus vaccination is not given at birth because the neonatal immune system is immature and unable to mount a proper memory immune response against the tetanus toxoid. The first dose of the diphtheria-pertussis-tetanus series is commonly administered at 2 months of age. In areas of endemic tetanus disease, this vaccine can be given as early as 4-6 weeks of age, but not earlier.</p>\n<p><strong>Extraedge:</strong></p><p>Tetanus is an infection caused by bacteria called Clostridium tetani. When these bacteria enter the body, they produce a toxin that causes painful muscle contractions. Another name for tetanus is “lockjaw”. It often causes a person's neck and jaw muscles to lock, making it hard to open the mouth or swallow.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old previously healthy girl is brought to the emergency department due to a day of fever, abdominal pain, and diarrhea. The symptoms began abruptly with high fever and cramping, periumbilical abdominal pain, and were quickly followed by low-volume diarrhea mixed with blood and mucus. The patient has had no sick contacts and has not traveled recently; the family had dinner at a buffet restaurant 3 days ago. The temperature is 38.9 °C (102 °F). Physical examination reveals mild diffuse abdominal tenderness with no guarding or rebounds tenderness. Bowel sounds are hyperactive. Stool occult blood testing is positive, and there are numerous leukocytes in the stool. The culture of the stool yields gram-negative, oxidase-positive, curved rods. Which of the following is the most likely pathogen responsible for this patient's symptoms?", "options": [{"label": "A", "text": "Campylobacter jejuni", "correct": true}, {"label": "B", "text": "Escherichia coli", "correct": false}, {"label": "C", "text": "Salmonella enterica", "correct": false}, {"label": "D", "text": "Shigella flexneri", "correct": false}], "correct_answer": "A. Campylobacter jejuni", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Campylobacter jejuni Campylobacter jejuni is a motile, oxidase-positive, curved, gram-negative rod. This pathogen resides in the gastrointestinal tract of a wide range of mammals and is transmitted via the fecal-oral route. Most cases arise when humans ingest contaminated food, particularly undercooked poultry or unpasteurized milk, but a minority of infections are caused by close contact with domesticated animals (e.g., dogs, farm animals).</p>\n<p><strong>Highyeild:</strong></p><p>C jejuni is entero-invasive and typically causes fever, abdominal pain, and diarrhea that may or may not be bloody. Stool studies usually reveal inflammation (blood, leukocytes); culture of the stool (enriched media at 42 °C [107.6 °F) and microaerophilic conditions) is diagnostic. Most cases are self-limited and resolved with supportive treatment within 5 days.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Escherichia coli causes many forms of gastroenteritis, including enterotoxin-mediated watery diarrhea (enterotoxigenic), Shiga toxin-mediated hemorrhagic colitis (enterohemorrhagic), and invasive colitis (entero-invasive). Although this pathogen is a gram-negative enteric rod, it is oxidase-negative and not typically described as curved. Option: C. Non-typhoidal Salmonella (S enterica) is a common cause of bacterial gastroenteritis. This entero-invasive pathogen frequently causes self-limited abdominal pain, fever, and watery diarrhea (bloody diarrhea is less common but can occur). However, Salmonella is oxidase negative and not typically described as curved. Option: D. Shigella is a highly virulent bacterium that is often transmitted via the fecal-oral route in daycare centers or other areas of communal habituation. It causes inflammatory colitis with fever; abdominal pain; and mucoid, bloody, and/or watery diarrhea. Shiga toxin, which irreversibly inhibits host cell protein synthesis, is a major virulence factor. However, Shigella is oxidase-negative and is not typically described as curved.</p>\n<p><strong>Extraedge:</strong></p><p>Campylobacter jejuni Structure: Thin,gram (-) rods with comma, S or gull wings shapes, motile with a single polar flagellum. Culture: Charcoal or blood (remove toxic oxygen radicals) with antibiotic added media is required grows at 37-42°C in a microaerophilic conditions (5%- 7% oxygen) and 5%-10% CO2 on selective Skirrow's medium contains vancomycin,polymyxin B, and trimethoprim . Colonies are colorless to gray. Growth characteristics: oxidase (+), catalase (+) XSmall size of Campylobacter is used for recovering by filtration of stool specimen (0.45 μm filter) Do not oxidize or ferment carbohydrates Antigenic structure: LPS, enterotoxins</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 8-year-old boy with acute lymphoblastic leukemia receiving maintenance chemotherapy is hospitalized due to fever and neutropenia. Treatment with broad-spectrum intravenous antibiotics is begun and the patient's fever resolves. His neutrophil count increases with granulocyte colony-stimulating factor therapy and blood cultures remain negative. On day 5 of hospitalization, the patient experiences nausea, abdominal cramping, and 6-8 episodes of watery diarrhea. The temperature is 37.7 °C (100 °F). Physical examination shows mild lower abdominal tenderness without guarding or rebound tenderness. Stool testing for occult blood is negative. Which of the following is the single best stool test to establish the cause of this patient's diarrhea?", "options": [{"label": "A", "text": "Culture on sorbitol-MacConkey agar", "correct": false}, {"label": "B", "text": "Enzyme immunoassay for bacterial antigen", "correct": false}, {"label": "C", "text": "PCR for the bacterial gene encoding a toxin", "correct": true}, {"label": "D", "text": "Microscopy after modified acid-fast staining", "correct": false}], "correct_answer": "C. PCR for the bacterial gene encoding a toxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>PCR for the bacterial gene encoding a toxin This child who developed diarrhea, nausea, and abdominal cramping while on antibiotics should be tested for Clostridium difficile infection (CDI). Patients who develop acute diarrhea (≥3 loose stools in 24 hours), particularly those with risk factors (e.g., hospitalization, antibiotic use), should have stool samples sent for evaluation.</p>\n<p><strong>Highyeild:</strong></p><p>Diagnostic testing for Clostridium difficile infection Nucleic acid amplification test (NAAT): Uses a polymerase chain reaction to detect genes present in toxigenic strains (e.g., toxin B- encoding gene). This test is highly sensitive and specific for toxigenic strains but does not distinguish active toxin production and may lead to overdiagnosis in asymptomatic carriers. Enzyme immunoassays (EIA): Uses antibodies to detect C. difficile antigens or toxins. EIA for bacterial toxins is highly specific but has poor sensitivity as large amounts of toxin are required. In contrast, EIA for glutamate dehydrogenase (a bacterial antigen expressed by all C. difficile isolates) has better sensitivity but cannot distinguish toxin-producing strains.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Culture on sorbitol-MacConkey agar is used to diagnose Escherichia coli O157:H7 (i.e., Entero-hemorrhagic E. coli [EHEC)). EHEC presents with bloody diarrhea; this patient's non-bloody diarrhea and recent antibiotic exposure make CDI 1'-Carbonyldiimidazole more likely. Option: B. NAAT Nucleic acid amplification tests are considered the most sensitive method for diagnosis of CDI in patients with clinical symptoms. EIA Enzyme immunoassays for bacterial toxins can be added as part of a multistep algorithm to increase the specificity of active disease; however, it is not recommended for use alone. Option: D. Modified acid-fast staining is used to diagnose cryptosporidium infection, which causes chronic diarrhea (particularly in HIV-infected patients). This patient's current hospitalization and antibiotic use make CDI more likely.</p>\n<p><strong>Extraedge:</strong></p><p>Campylobacter jejuni Structure: Thin,gram (-) rods with comma, S or gull wings shapes, motile with a single polar flagellum. Culture: Charcoal or blood (remove toxic oxygen radicals) with antibiotic added media is required grows at 37-42°C in a microaerophilic conditions (5%- 7% oxygen) and 5%-10% CO2 on selective Skirrow's medium contains vancomycin,polymyxin B, and trimethoprim . Colonies are colorless to gray. Growth characteristics: oxidase (+), catalase (+) XSmall size of Campylobacter is used for recovering by filtration of stool specimen (0.45 μm filter) Do not oxidize or ferment carbohydrates Antigenic structure: LPS, enterotoxins</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A hospitalized patient developed severe diarrhea and pseudomembranous colitis within five days after antibiotic therapy was initiated. The severe diarrhea and pseudomembranous colitis occurred as a result of which of the following?", "options": [{"label": "A", "text": "Collagenase", "correct": false}, {"label": "B", "text": "Fibrinolysin", "correct": false}, {"label": "C", "text": "Toxin A and B", "correct": true}, {"label": "D", "text": "Lecithinase", "correct": false}], "correct_answer": "C. Toxin A and B", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxin A and B Pseudomembranous colitis refers to swelling or inflammation of the large intestine (colon) due to an overgrowth of Clostridioides difficile (C difficile) bacteria. This infection is a common cause of diarrhea after antibiotic use.</p>\n<p><strong>Highyeild:</strong></p><p>Pathogenesis of pseudomembranous colitis is toxin mediated. C. difficile (nontoxigenic strains) may be a part of normal intestinal flora, however only the toxigenic strains can cause pseudomembranous colitis: It produces two toxins: Toxin A (enterotoxin) and Toxin B (cytotoxin). Both are important for pathogenesis. Infants do not develop symptoms because they lack suitable mucosal toxin receptors The pathogenicity of Clostridium difficile is mainly mediated by two exotoxins: toxin A (TcdA) and toxin B (TcdB). These toxins primarily disrupt the cytoskeletal structure and the tight junctions of target cells causing cell rounding and ultimately cell death.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and D. Self-explanatory</p>\n<p><strong>Extraedge:</strong></p><p>2. Pseudomembranous colitis: Complication of antibiotics ---> alteration of normal flora Overgrowth of Clostridium deficile. Has cytopathic and enteropathic toxins Develops 6wks after: a. Clindamycin b. Ampicillin C. Cephalosporin Dx: - history - latex fixation test - colonoscopy (Pseudomembrane) Tx: 1. stopped antibiotic ----> metronidazole/vancomycin 2. cholestyramine - ---> binds w/ toxin 3. Toxic megacolon---> total colectomy w/ileostomy</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Clostridium difficile, as the causative agent in antibiotic-associated diarrhea, can best be detected using which of the following gold standard laboratory tests?", "options": [{"label": "A", "text": "Gas-liquid chromatography", "correct": false}, {"label": "B", "text": "Pseudomembranous visualization", "correct": false}, {"label": "C", "text": "Rapid fatty acid detection assays", "correct": false}, {"label": "D", "text": "Tissue culture toxin detection assay", "correct": true}], "correct_answer": "D. Tissue culture toxin detection assay", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tissue culture toxin detection assay Tissue culture assay is considered the gold standard. Difficile (culture, toxin gene NAAT or antigen test) Detection of Clostridium difficile toxin by enzyme immunoassay, tissue culture test, and culture is done. Cell cytotoxicity test is a tissue culture to detect the C. difficile toxin. It is a test that looks for the effects of cytotoxin (cytotoxicity) on human cells grown in culture. It is a sensitive method to detect toxins, but it requires 24 to 48 hours to get the test result.</p>\n<p><strong>Highyeild:</strong></p><p>Toxin demonstration: Toxins can be detected by various methods: Cell culture cytotoxin test: It is highly specific but not as sensitive as stool culture; it is time-consuming. Enzyme immunoassay for toxin A and/or toxin B in stool is rapid, but not sensitive. PCR for C. difficile toxin B gene in stool is highly specific and sensitive.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B, and C. These tests are not used in the diagnosis of Clostridium difficle infection.</p>\n<p><strong>Extraedge:</strong></p><p>In gas gangrene and anaerobic cellulitis, the primary pathogen can be any one of various clostridial species including C perfringens (80%), C novyi (40%), C septicum (20%), and, occasionally, C bifermentans, C histolyticum, or C fallax.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following bacteria is an obligate anaerobe:", "options": [{"label": "A", "text": "Nocardia", "correct": false}, {"label": "B", "text": "Clostridium tetani", "correct": true}, {"label": "C", "text": "Hemophilus Influenzae", "correct": false}, {"label": "D", "text": "Pseudomonas Aeroginosa", "correct": false}], "correct_answer": "B. Clostridium tetani", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium tetani tetani is an obligately anaerobic, gram-positive bacillus with terminal round spores (drumstick appearance): It is the causative agent of ‘tetanus’ manifested by skeletal muscle spasms and autonomic nervous system disturbance. C. tetani is widely distributed in the soil, hospital, and intestine of man and animals.</p>\n<p><strong>Highyeild:</strong></p><p>Tetanus is an infection caused by bacteria called Clostridium tetani. When these bacteria enter the body, they produce a toxin that causes painful muscle contractions. Another name for tetanus is “lockjaw”. It often causes a person's neck and jaw muscles to lock, making it hard to open the mouth or swallow.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. anthracis belongs to the Bacillus genus which are mostly saprophytic, aerobic, spore-forming organisms. Option: C. Hemophilus are either aerobic or facultatively anaerobic.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Botulinum toxin type B acts on which of the following-", "options": [{"label": "A", "text": "Synaptobrevin", "correct": true}, {"label": "B", "text": "Syntaxin", "correct": false}, {"label": "C", "text": "SNAP-25 Synaptosomal-Associated Protein,", "correct": false}, {"label": "D", "text": "Synaptotagmin", "correct": false}], "correct_answer": "A. Synaptobrevin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Synaptobrevin Synaptobrevin is an intrinsic membrane protein of small synaptic vesicles. , specialized secretory organelles of neurons that actively accumulate neurotransmitters and participate in their calcium-dependent release by exocytosis.</p>\n<p><strong>Highyeild:</strong></p><p>Botulinum Toxin Type B binds to and cleaves the synaptic Vesicle Associated Membrane Protein (VAMP, also known as synaptobrevin) which is a component of the protein complex responsible for docking and fusion of the synaptic vesicle to the presynaptic membrane, a necessary step for neurotransmitter release. Toxin B, D, F, and G cleave only synaptobrevin</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Botulinum toxin is absorbed from the gut, enters the blood circulation, and binds to receptors of presynaptic membranes of motor neurons of the peripheral nervous system and cranial nerves. The toxin does not cross the blood-brain barrier or affect the central nervous system. Proteolysis— by the L chain of botulinum toxin—of the target SNARE proteins (soluble-N-ethyl maleimide-sensitive factor attachment protein) in the neurons inhibits the release of acetylcholine at the synapse, resulting in lack of muscle contraction and paralysis. The SNARE proteins are synaptobrevin (also known as vesicle-associated membrane protein or VAMP), SNAP 25, and syntaxin. The toxins of C botulinum types A, C, and E cleave the 25,000 kDa SNAP 25. Type C also cleaves syntaxin Option: C. Toxin A, C, and E cleave SNAP25 Option: D. BoNT/B, /DC, and /G, all three toxins that utilize synaptotagmin I and II (Syt-I and Syt-II, respectively) as their protein receptors, bind to Syt-I and -II of mouse/rat, bovine, and human origin by isothermal titration calorimetry analysis. BoNT/G had the highest affinity for human Syt-I, and BoNT/DC had the highest affinity for bovine Syt-II.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Opacity around colonies of Clostridium perfringens on egg yolk agar is due to-NEET pattern?", "options": [{"label": "A", "text": "Theta toxin", "correct": false}, {"label": "B", "text": "Lecithinase", "correct": true}, {"label": "C", "text": "Desmolase", "correct": false}, {"label": "D", "text": "Cytokinin", "correct": false}], "correct_answer": "B. Lecithinase", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lecithinase Clostridium perfringens, Growth; Lecithinase positive; white, opaque. The alpha toxin of C. perfringens has phospholipase activity Lecithinase is a type of phospholipase that acts upon lecithin.</p>\n<p><strong>Highyeild:</strong></p><p>perfringens alpha-toxin (lecithinase) causes myonecrosis and hemolysis. Clostridium perfringens is a Gram-positive, rod-shaped, anaerobic, spore-forming pathogenic bacterium of the genus Clostridium. Clostridium perfringens (C. perfringens) is a spore-forming gram-positive bacterium that is found in many environmental sources as well as in the intestines of humans and animals. Egg Yolk Agar, modified is based on the original formula for Egg Yolk Agar. Clostridium perfringens, Growth; Lecithinase positive; white, opaque. Egg Yolk Agar is used for the isolation and differentiation of Clostridium species. The alpha toxin of C. perfringens has phospholipase activity Lecithinase is a type of phospholipase that acts upon lecithin. It can be produced by Clostridium perfringens, Staphylococcus aureus, Pseudomonas aeruginosa or Listeria C. perfringens alpha-toxin (lecithinase) causes myonecrosis and hemolysis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. The alpha toxin of C perfringens type A is a lecithinase, and its lethal action is proportionate to the rate at which it splits lecithin (an important constituent of cell membranes) to phosphorylcholine and diglyceride. The alpha-toxin also aggregates platelets, thereby leading to the formation of thrombi in small blood vessels and adding to poor tissue profusion, and extending the consequences of anaerobiosis, namely, destruction of viable tissue (gas gangrene). The theta toxin has similar hemolytic and necrotizing effects but is not a lecithinase. Option: C. A desmolase is any of the various enzymes that catalyze the formation or destruction of carbon-carbon bonds within a molecule. These enzymes play a significant role in cellular respiration and fermentation. Desmolases are involved in steroidogenesis. Option: D. Cytokinins (CK) are a class of plant hormones that promote cell division, or cytokinesis, in plant roots and shoots.</p>\n<p><strong>Extraedge:</strong></p><p>Clostridium perfringens (formerly known as C. welchii, or Bacillus welchii) is a Gram-positive, rod-shaped, anaerobic, spore-forming pathogenic bacterium of the genus Clostridium.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 23 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 49-year-old man presents in medicine OPD with complaints of fever, sore throat and myalgia. On examination, respiratory rate was 18/min, and oxygen saturation was 99%. In Chest X-ray, no abnormality was detected. He had a travel history from Beijing 1 week before, and the Physician suspects an RNA virus infection in the patient. He advised home care for patients in quarantine. Family members observe their symptoms for 14 days and should maintain a 1-2 meter distance from the patient. Which of the following RNA viruses have an incubation period of up to 14 days?", "options": [{"label": "A", "text": "Influenza virus", "correct": false}, {"label": "B", "text": "Parainfluenza virus", "correct": false}, {"label": "C", "text": "SARS CoV-2", "correct": true}, {"label": "D", "text": "Respiratory syncytial virus", "correct": false}], "correct_answer": "C. SARS CoV-2", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>SARS CoV-2 The above scenario suggests COVID-19/SARS-CoV-2 infection. The incubation period, which is the time between infection and onset of symptoms for COVID-19, is up to 14 days. Exposed individuals, in this case, should observe symptoms for 14 days. Also, they should follow infection control measures like Hand Hygiene, social distancing and frequent environmental cleaning. Incubation periods Virus Incubation period Influenza (OPTION A) 1-4 days Parainfluenza (OPTION B) 5-6 days Respiratory syncytial virus (OPTION D) 3-5 days Mumps 19 days COVID-19 (OPTION C) 14 days MERS 2-14 ays</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "What is the mode of transmission of SARS-CoV-2?", "options": [{"label": "A", "text": "Aerosol transmission", "correct": false}, {"label": "B", "text": "Contact transmission", "correct": false}, {"label": "C", "text": "Droplet transmission", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above Respiratory and contact routes usually transmit COVID-19. But can have aerosol transmission during aerosol-generating procedures like endotracheal intubation. So option D is correct. M odes of transmission for SARS-CoV-2, including contact, droplet, airborne, fomite, faecal-oral, bloodborne, mother-to-child, and animal-to-human transmission. Infection with SARS-CoV-2 primarily causes respiratory illness ranging from mild disease to severe disease and death, and some people infected with the virus never develop symptoms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male was admitted to emergency high-grade fever and difficulty in breathing. The temperature was 102 F on examination, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. The medical officer ordered a Rapid Antigen test for COVID-19, which was positive. He has to do emergency endotracheal intubation for patients. Which of the following personal protective equipment prevents virus transmission from patient to doctor while doing intubation?", "options": [{"label": "A", "text": "Surgical/ Medical Mask", "correct": false}, {"label": "B", "text": "N95 Mask", "correct": true}, {"label": "C", "text": "Both a and b", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "B. N95 Mask", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>N95 Mask During procedures like endotracheal intubation, there is a risk of aerosol formation, smaller than droplets. In this case, the medical mask should be replaced by a N95 respirator.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. COVID-19 enters the respiratory tract via droplets formed during coughing and sneezing, which can be prevented by wearing a medical mask and social distancing. Options C and D. As N95 will be used in this case due to aerosol transmission risk, C and D are incorrect. Intubation chamber also helps prevent the transmission of covid to healthcare workers. However, it often requires greater skill, and video laryngoscope use is helpful.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male was admitted to emergency high-grade fever and difficulty in breathing. The temperature was 102 F on examination, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. The medical officer ordered a Rapid Antigen test for COVID-19, which was positive. Which of the following viral proteins helps in the attachment to Host cells?", "options": [{"label": "A", "text": "S protein", "correct": true}, {"label": "B", "text": "N protein", "correct": false}, {"label": "C", "text": "E protein", "correct": false}, {"label": "D", "text": "RdRp protein", "correct": false}], "correct_answer": "A. S protein", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>S protein SARS Cov-2 has 4 structural proteins (N, S, M and E) and 16 non-structural Proteins, e.g. RNA dependent RNA polymerase (RdRp) S pike (S) protei n helps in the attachment of viruses with target host cells. For virus entry, Spike protein is cleaved by host cell proteases enzyme, which produces the S1 subunit and S2 subunit. S1 binds with ACE-2 S2 helps in the fusion of the viral envelope with the host envelope.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Nucleocapsid (N) protein: present in Nucleocapsid surrounding +sense, ssRNA Option C. envelope (E) protein - transmembrane protein with ion-channel activity. M-Membrane glycoprotein- gives shape to the virus. Option D. Helps in replication.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 49-year-old man presents in medicine OPD with fever, sore throat and myalgia complaints. On examination, respiratory rate was 18/min, and oxygen saturation was 99%. In Chest X-ray, no abnormality was detected. He had a travel history from Beijing 1 week before, and Physician suspects SARS CoV-2 virus infection in the patient. Which of the following samples should be collected for the RT-PCR test in this case?", "options": [{"label": "A", "text": "Blood", "correct": false}, {"label": "B", "text": "Urine", "correct": false}, {"label": "C", "text": "Throat swab", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Throat swab", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Throat swab Sample collection for COVID-19 For RT-PCR: Oropharyngeal (throat) and nasopharyngeal swabs are the preferred samples collected using Dacron/polyester swabs dipped in viral transport media (VTM) after collection. The head should be tilted by 70 degrees while collecting NPS. Between OPS and NPS, the NPS has a higher sensitivity. Bronchoalveolar lavage or Endotracheal aspirate can be collected in the case of intubated patients. Rapid Antigen Test: Nasopharyngeal swab preferred</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Antibody detection: Blood/ serum Option B. There is no role of urine samples in laboratory diagnosis of COVID-19 Infection. Option D. Oropharyngeal (throat) and nasal/ nasopharyngeal swabs are the preferred samples. Option D is incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 49-year-old man presents in medicine OPD with fever, sore throat and myalgia complaints. On examination, respiratory rate was 18/min, and oxygen saturation was 99%. In Chest X-ray, no abnormality was detected. He had a travel history from Beijing 1 week before, and Physician suspects SARS CoV-2 virus infection in the patient. Which of the following statements is incorrect regarding sample collection for COVID-19 sample collection?", "options": [{"label": "A", "text": "Oropharyngeal swabs and nasopharyngeal swabs are the preferred samples.", "correct": false}, {"label": "B", "text": "N95 mask is essential for a sample collection from a suspected patient.", "correct": false}, {"label": "C", "text": "For the transportation of samples, double-layer packing should be done.", "correct": true}, {"label": "D", "text": "Sample should be dipped in Viral transport media after collection.", "correct": false}], "correct_answer": "C. For the transportation of samples, double-layer packing should be done.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>For the transportation of samples, double-layer packing should be done. Samples collected for COVID-19 testing should be appropriately labelled, and a triple layer packaging method to be used for the transport of samples to the laboratory.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male was admitted to emergency high-grade fever and difficulty in breathing. On examination, the temperature was 102 F, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. Which of the following is the point of care test for diagnosis of COVID-19 so that appropriate treatment can be started timely?", "options": [{"label": "A", "text": "NAAT Nucleic Acid Amplification Test", "correct": false}, {"label": "B", "text": "Antigen detection", "correct": true}, {"label": "C", "text": "Antibody detection", "correct": false}, {"label": "D", "text": "Sequencing", "correct": false}], "correct_answer": "B. Antigen detection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigen detection Point of care test is a test that can be conducted at a patient's bedside and gives rapid results. Antigen detection: For COVID-19, a r apid immunochromatography test is available for the qualitative detection of specific Nucleocapsid (N) protein of SARS CoV-2, which can be done at the patient's bedside . A nasopharyngeal swab is collected for this test, which is immersed in a viral extraction buffer. In the buffer, the virus is inactivated, and antigen is released. Test to be conducted within an hour, and the result is available within 15-30 minutes, depending on the kit used. However, the disadvantage of RAT Rapid Antigen Tests is that it has a low sensitivity (about 60 per cent)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Turn around time (TAT) for Nucleic Acid Amplification Test (NAAT) is 4-5 hours and is the gold standard test for COVID-19 diagnosis. Option C. Antibody (IgG) can be detected only after 1-2 weeks of infection, as antibodies appear late. Therefore, it should not be used for clinical diagnosis. Option D. Sequencing is not routinely used for diagnostic purposes but helps determine any mutation in the SARS-CoV-2 genome. Have an epidemiological advantage.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male was admitted to emergency high-grade fever and difficulty in breathing. The temperature was 102 F on examination, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. Which of the following is the gold standard test for diagnosis of COVID-19?", "options": [{"label": "A", "text": "Real-time PCR", "correct": true}, {"label": "B", "text": "Antigen detection", "correct": false}, {"label": "C", "text": "Antibody detection", "correct": false}, {"label": "D", "text": "Sequencing", "correct": false}], "correct_answer": "A. Real-time PCR", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Real-time PCR Laboratory tests for COVID-19 Types of COVID-19 Tests PCR Test Antigen Rapid Test (ART) Antibody/Serology Test Purpose of Test Diagnosis of active SARS-CoV-2 infection (COVID-19) Diagnosis of active SARS-CoV-2 infection (COVID-19) Check for past SARS-CoV-2 infection (COVID-19) Sample Type The sample is taken with a swab from the nose or mouth The sample is taken with a swab from the nose or mouth The blood sample is taken with a finger prick or venous blood draw Use of Test ● Symptomatic individuals ● Stay-Home Notice (SHN) exit swab ● Use of Test ● Quarantine Order (QO) entry and exit swab ● Rostered routine testing ● Screening for pre-event testing ● Rostered routine testing ● Differentiate between acute and old infections in cases that test positive for COVID-19 Turnaround Time As early as 24 hours after sample collection As early as 30 minutes after sample collection One to three weeks on average Limitations Unable to differentiate between acute and old infections ● Potentially high false-negative rate in individuals with low viral load ● Higher false positive rate than PCR tests Unable to rule out acute/early infection if the antibody test is negative 750 × 706</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male admitted in emergency high-grade fever and difficulty in breathing, on examination, the temperature was 102 F and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. RT-PCR for COVID-19 is performed for diagnosis. Which of the following gene is targeted for confirmation of COVID-19 infection?", "options": [{"label": "A", "text": "M gene", "correct": false}, {"label": "B", "text": "E gene", "correct": false}, {"label": "C", "text": "S gene", "correct": false}, {"label": "D", "text": "ORF1a/b", "correct": true}], "correct_answer": "D. ORF1a/b", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>ORF1a/b Real-Time Polymerase Chain Reaction (RT PCR)/ Nucleic Acid Amplification Test (NAAT) is the gold standard test for COVID-19 diagnosis. Most of the kits target two genes in a single reaction-one for screening and the other for confirmation. #EXTRA-GENES FOR SARS COV2 CONFIRMATION Genes for confirmation- species-specific, i.e. SARS- CoV-2 RNA dependent RNA polymerase (RdRp) Open reducing frames (ORF1a/b) T he non-structural genes are used for confirmation as these are not shared by other Coronavirus. The structural genes have non-specific sharing. #EXTRA: SARS CoV-2 Structure</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male admitted in high-grade emergency fever and difficulty in breathing, on examination, the temperature was 102 F, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. A rapid antigen test for COVID-19 was done, which was reported negative. Which of the following statements is true in this case?", "options": [{"label": "A", "text": "Treat him like a SARS-CoV-2 negative patient.", "correct": false}, {"label": "B", "text": "Gene sequencing is the ideal choice for diagnosis.", "correct": false}, {"label": "C", "text": "RT PCR for COVID-19 to be performed for confirmation.", "correct": true}, {"label": "D", "text": "Repeat the Antigen assay with a different kit.", "correct": false}], "correct_answer": "C. RT PCR for COVID-19 to be performed for confirmation.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>RT PCR for COVID-19 to be performed for confirmation. In the case mentioned above, the patient is symptomatic. Therefore RT PCR test should be performed Antigen detection assay: For COVID-19, a rapid immunochromatography test is available for the qualitative detection of specific Nucleocapsid (N) protein of SARS CoV-2, which can be done at the patient bedside (Point-of-care test). The test will be conducted within an hour, and the result will be available within 20-30 minutes.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old male was admitted to high-grade emergency fever and difficulty in breathing. The temperature was 102 F on examination, and oxygen saturation was 40%. CT chest was suggestive of bilateral lung consolidation. A rapid antigen test for COVID-19 was done, which was reported negative. The medical officer ordered RT PCR for COVID-19. What is the reason for the RT PCR test?", "options": [{"label": "A", "text": "COVID-19 Antigen assays have low specificity.", "correct": false}, {"label": "B", "text": "COVID-19 Antigen assays have high specificity", "correct": false}, {"label": "C", "text": "COVID-19 Antigen assays have low sensitivity", "correct": true}, {"label": "D", "text": "COVID-19 Antigen assays have high sensitivity", "correct": false}], "correct_answer": "C. COVID-19 Antigen assays have low sensitivity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>COVID-19 Antigen assays have low sensitivity For COVID-19, a rapid immunochromatography test for Antigen assay is available for the qualitative detection of specific Nucleocapsid (N) protein of SARS CoV-2, which can be done at the patient bedside (Point-of-care test). Test to be conducted within an hour; the result is available within 20-30 minutes. It is highly specific (99-100%)[OPTION A AND B] but less sensitive (50-84%) [OPTION C AND D]. Therefore, RT PCR should be done for symptomatic Antigen negative patients to confirm the diagnosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- So, Options A, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "For COVID-19, Chemiluminescence for detection of IgG antibodies is available. Antibody detection for COVID-19 is for:", "options": [{"label": "A", "text": "Clinical diagnosis", "correct": false}, {"label": "B", "text": "Point of care test", "correct": false}, {"label": "C", "text": "Sero-surveillance", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Sero-surveillance", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sero-surveillance For IgG detection, various tests like ELISA, Immunochromatographic and chemiluminescence tests are available. As IgG Antibodies appear late (after 2 weeks of infection), this test is not useful for definitive diagnosis of patients. Uses of Antibodies detection in case of COVID-19: Sero-surveillance of the exposed population, including asymptomatic patients, to implement prevention and control of infection For survey in health care workers, immunocompromised, and other front-line workers to know the status of infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. For Clinical diagnosis, the RT PCR test is the gold standard test. Option B. Another test that can be used for diagnosis is the Rapid Antigen assay, a point-of-care test that can be performed at the patient's bedside. Option D. Option D is incorrect as Antibody detection can be used only for serosurveillance, not for clinical diagnosis or as a point-of-care test.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "There are various COVID-19 vaccines available and effective in Phase III clinical trials. Which of the following vaccines have viruses as vectors to generate an immune response?", "options": [{"label": "A", "text": "Covishield", "correct": true}, {"label": "B", "text": "Covaxin", "correct": false}, {"label": "C", "text": "Moderna", "correct": false}, {"label": "D", "text": "ZyCoV-d", "correct": false}], "correct_answer": "A. Covishield", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Covishield Covishield is viral vector medicine that uses chimpanzee Adenovirus, a safe non-replicating virus that can not produce disease but produces coronavirus proteins. These coronavirus proteins generate an immune response and provide immunity. Other examples of viral vector vaccines for COVID-19 are AstraZeneca, Sputnik V and Johnson & Johnson.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. uses Inactivated virus, which cannot cause disease but generates an immune response. Option C. Moderna is an mRNA-based vaccine. Option D. ZyCoV-D is DNA based vaccine Other vaccines: Novivax: protein-based vaccine</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In India, 2 vaccines are licensed for use in a phased manner. Which of the following statements is incorrect about COVID-19 VACCINATION IN INDIA?", "options": [{"label": "A", "text": "Uses non-replicating modified chimpanzee Adenovirus as a vector.", "correct": false}, {"label": "B", "text": "Covid-19 vaccine is administered in two doses by IM route.", "correct": false}, {"label": "C", "text": "Recovered COVID-19 patients can also have vaccines.", "correct": false}, {"label": "D", "text": "To be stored at -80 degrees Celsius only.", "correct": true}], "correct_answer": "D. To be stored at -80 degrees Celsius only.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>To be stored at -80 degrees Celsius only. Two vaccines are licensed in India- Covishield and Covaxin, which need to be stored at 2-8 degrees Celsius. Pfizer vaccine needs storage at -90 to -60 degrees Celsius as its an mRNA vaccine.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Covishield- viral vector medicine, uses modified Chimpanzee Adenovirus, a safe non-replicating virus that can not produce disease but produces coronavirus proteins. These coronavirus proteins generate an immune response and provide immunity. Other examples of viral vector vaccines for COVID-19 are AstraZeneca, Sputnik V and Johnson & Johnson. Covaxin: Inactivated whole virion vaccine, which cannot cause disease but generates an immune response. Option B. Both licensed vaccines in India are administered in two doses by IM route a minimum 4 weeks apart.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 24 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 24-year-old woman, gravida 1 para 0, at 26 weeks gestation comes to the emergency department due to abdominal cramping and vaginal bleeding. She recently emigrated from Bolivia and reports no prior medical problems. The patient's only medication is a daily multivitamin. Immunization status is unknown. The patient spontaneously delivers a stillborn fetus with multiple congenital malformations. Fetal autopsy reveals microcephaly with thin cerebral cortices, ventriculomegaly, and subcortical calcifications. Viral RNA of a neurotropic virus is detected in the body fluids of the mother and the fetus. Transplacental transmission of this virus causes apoptosis of neural progenitor cells in the developing fetus, leading to disruption of neuronal proliferation, migration, and differentiation. Which of the following viruses most likely caused this patient's in-utero infection?", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": false}, {"label": "B", "text": "Herpes simplex virus", "correct": false}, {"label": "C", "text": "Zika virus", "correct": true}, {"label": "D", "text": "Rubella virus", "correct": false}], "correct_answer": "C. Zika virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Zika virus Zika virus is a single-stranded RNA virus belonging to the Flavivirus genus. Transmission occurs primarily via an Aedes mosquito bite, but infected patients can also spread the virus via genital secretions.</p>\n<p><strong>Highyeild:</strong></p><p>Congenital Zika : The neurotropic virus can cross the placenta and infect and destroy feta I neural progenitor cells, causing congenital Zika syndrome and possible fetal demise. Fetal brain development is impaired due to the disruption of normal proliferation, migration, and differentiation of neurons. Classic findings in affected newborns include microcephaly with facial features out of proportion to head size, arthrogryposis (contractures), seizures, hypertonia, and ocular abnormalities. Loss of brain mass (eg, cortical thinning, ventriculomegaly), as well as subcortical calcifications, are typically present. Diagnosis is confirmed by the detection of Zika RNA (real-time reverse transcriptase PCR) in serum, urine, or cerebrospinal fluid. The mainstay of treatment for surviving infants is supportive care with management of feeding difficulties, hydrocephalus, and seizures. Pregnant women should be counseled to avoid traveling to areas with ongoing Zika transmission.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A & B. Cytomegalovirus (CMV), herpes simplex virus (HSV), and varicella zoster virus (VZV) are double-stranded DNA viruses that can be transmitted in utero and cause CNS abnormalities in the fetus. Typical CMV findings include hearing loss, chorioretinitis, jaundice, and periventricular calcifications. When transmitted in utero, HSV and VZV can cause diffuse cutaneous lesions and severe brain destruction; hypoplasia of the limbs and eyes is also commonly seen with fetal VZV infection. Option D. Rubella virus is a single-stranded RNA virus that typically presents with cardiac defects, hearing loss, and cataracts. Congenital Zika syndrome Pathogenesis ● Single-stranded RNA Flavivirus ● Transplacental transmission to fetus ● Targets neural progenitor cells Clinical features ● Microcephaly, craniofacial disproportion ● Neurologic abnormalities (eg, spasticity, seizures) ● Ocular abnormalities Diagnosis ● Neuroimaging: Calcifications, ventriculomegaly, cortical thinning ● Zika RNA detection</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "AHC (Acute hemorrhagic conjunctivitis) is caused by which enterovirus type?", "options": [{"label": "A", "text": "69", "correct": false}, {"label": "B", "text": "68", "correct": false}, {"label": "C", "text": "70", "correct": true}, {"label": "D", "text": "71", "correct": false}], "correct_answer": "C. 70", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>70 The etiologic agent was confirmed as enterovirus type 70 by a modified centrifugation-enhanced culture method followed by immunofluorescence and neutralization tests. After nearly a decade, this virus is reemerging as a cause of acute hemorrhagic conjunctivitis in India. Acute conjunctivitis can be caused by viruses including enterovirus 70 (EV-70). Acute hemorrhagic conjunctivitis (AHC) in humans caused by enterovirus 70 (EV70) is a cause of Selected Types of Conjunctivitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and D . Are different from the correct options. They all can cause meningitis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient presented to the hospital with severe hydrophobia. You suspect rabies and obtained corneal scrapings from the patient. What test should be done on this specimen for a diagnosis of rabies?", "options": [{"label": "A", "text": "Negri bodies", "correct": false}, {"label": "B", "text": "Antibodies to rabies virus", "correct": false}, {"label": "C", "text": "RT-PCR for rabies virus", "correct": true}, {"label": "D", "text": "Indirect immunofluorescence", "correct": false}], "correct_answer": "C. RT-PCR for rabies virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>RT-PCR for rabies virus The test is a real-time reverse transcription-polymerase chain reaction (rRT-PCR) assay that can be used to diagnose the virus in respiratory and serum samples. The RT-PCR test is a method of testing by taking a nasal/throat swab from a patient. Detection of RNA in saliva and CSF by PCR: T he demonstration of viral nucleic acid in saliva, CSF, corneal smear, and skin biopsy by Polymerase Chain Reaction (PCR) appears to be quite promising for the antemortem diagnosis of human rabies. For the rabies virus, those viral factories are called Negri bodies (NBs) . These are usually post-mortem diagnostic tests. NBs are cytoplasmic inclusion bodies in which viral RNAs (mRNAs as well as genomic and antigenomic RNAs) are synthesized. NBs are spherical, they can fuse, and can reversibly deform when encountering a physical barrier.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & D. Are incorrect. Negri Bodies In Brain Tissue Negri bodies round or oval inclusion bodies seen in the cytoplasm and sometimes in the processes of neurons of rabid animals after death. Negri bodies are Eosinophilic, sharply outlined, pathognomonic inclusion bodies (2-10 µm in diameter) found in the cytoplasm of certain nerve</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Arboviruses are transmitted by blood-sucking arthropods from one vertebrate host to another. Arboviruses are found in the following families:", "options": [{"label": "A", "text": "Flaviviruses", "correct": false}, {"label": "B", "text": "Bunyaviruses", "correct": false}, {"label": "C", "text": "Reoviruses", "correct": false}, {"label": "D", "text": "Arenaviruses", "correct": true}], "correct_answer": "D. Arenaviruses", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Arenaviruses Viruses in the family Arenaviridae are generally spread by rodents, with each virus associated with one, or a few, closely related rodent species that serve as the virus’ natural reservoir. These viruses cause viral hemorrhagic fevers. The types of rodents that spread arenaviruses are located across much of the world, i ncluding Europe, Asia, Africa, and the Americas. In some areas of the world, arenavirus infections in people are relatively common and can cause severe disease. Arbovirus is an informal name used to refer to any viruses that are transmitted by arthropod vectors. The word arbovirus is an acronym (arthropod-borne virus). The word arbovirus (tick-borne virus) is sometimes used to more specifically describe viruses transmitted by ticks, a superorder within the arthropods. These infections usually occur during warm weather months, when mosquitoes and ticks are active.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Flavivirus is a genus of positive-strand RNA viruses in the family Flaviviridae. The genus includes the West Nile virus, dengue virus, tick-borne encephalitis virus, yellow fever virus, Zika virus Option B. Bunyavirales is an order of single-strand, spherical, enveloped RNA viruses (formerly the Bunyaviridae family). The virus families in the Bunyavirales order that cause viral hemorrhagic fevers include Phenuiviridae, Arenaviridae, Nairoviridae, and Hantaviridae. Option C. Reoviruses (which also are called orthoreovirus to avoid confusion with the family Reoviridae) are nonenveloped viruses. Reovirus particles are composed of an inner protein shell (ie, core) of a diameter of 60 nm, which is surrounded by an outer protein shell (ie, outer capsid) that measures 81 nm in diameter. Options A, B, and All have arboviruses.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "First human disease proved to have a viral etiology was?", "options": [{"label": "A", "text": "Influenza", "correct": false}, {"label": "B", "text": "Yellow fever", "correct": true}, {"label": "C", "text": "HTV", "correct": false}, {"label": "D", "text": "Measles", "correct": false}], "correct_answer": "B. Yellow fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Yellow fever Yellow fever was seen as one of the most dangerous infectious diseases. In 1927, the yellow fever virus became the first human virus to be isolated, Yellow fever is spread by a species of mosquito common to areas of Africa and South America. Vaccination is recommended before traveling to certain areas. Yellow fever is an acute viral hemorrhagic disease transmitted by infected mosquitoes. The \"yellow\" in the name refers to the jaundice that affects patients. Yellow fever is caused by a virus that is spread by the Aedes aegypti These mosquitoes thrive in and near human habitations where they breed in even the cleanest water. Most cases of yellow fever occur in sub-Saharan Africa and tropical South America.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. There are four types of influenza viruses: A, B, C, and D. Human influenza A and B viruses cause seasonal epidemics of disease (known as flu season) almost every winter in the United States. Influenza A viruses are the only influenza viruses known to cause flu pandemics, i.e., global epidemics of flu disease. Option C. Early symptoms are general and include fever, fatigue, and muscle pain. Other symptoms may include headache, nausea, vomiting, diarrhea, and dizziness. Option D. Measles is an acute viral respiratory illness. It is characterized by a prodrome of fever (as high as 105°F) and malaise, cough, coryza, and conjunctivitis -the three “C”s -, a pathognomonic enanthem (Koplik spots) followed by a maculopapular rash. The rash usually appears about 14 days after a person is exposed. Options A, C, and D . Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "“Arbovirus,” short for the arthropod-borne virus, doesn't refer to one particular virus. Rather, it refers to a type of virus transmitted via insects that bite and feed on blood. This includes a large family of viruses. Arboviruses cause the following diseases:", "options": [{"label": "A", "text": "Encephalitis", "correct": false}, {"label": "B", "text": "Febrile diseases", "correct": false}, {"label": "C", "text": "Hemorrhagic fevers", "correct": false}, {"label": "D", "text": "Pneumonia", "correct": true}], "correct_answer": "D. Pneumonia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pneumonia The arboviruses that cause encephalitis are passed on to people and animals by insects. In rural areas, arboviruses that are carried by mosquitoes or ticks are the most common cause of arboviral infection. Arboviral encephalitis: Inflammation of the brain (encephalitis) caused by infection with an arbovirus, a virus transmitted by a mosquito, tick, or another arthropod. Infection of vertebrates, including humans, occurs when an infected arthropod feasts upon them for a blood meal. Symptoms of infection · encephalitis, meaning inflammation of the brain · febrile diseases, which involve a fever sometimes accompanied by a rash. Chikungunya virus infectio n is an important tropical arbovirus infection. The disease has similar clinical features to dengue but the patient usually has extreme joint pain. Chikungunya virus generally does not cause pneumonia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Encephalitis is an inflammation of the brain that can be caused by an Arthropod-borne virus (arbovirus). Arthropods include mosquitoes and ticks. In Illinois, arboviruses are transmitted to humans by the bites of infected mosquitoes. Option B. Arbovirus is an acronym for “Arthropod-borne virus” and is used to refer to any of the viral pathogens including Dengue fever and Chikungunya viruses (DENV and CHIKV) that are transmitted by arthropod vectors Option C. Viral hemorrhagic fever (VHF) syndrome is a potentially life-threatening infection typified by a combination of a capillary leak syndrome and bleeding diathesis. Most but not all agents causing VHF are arboviruses, with transmission to humans resulting from an arthropod bite. Options A, B, and C. Can all be caused by arboviruses.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A newborn presents with PDA and cataracts. Infection with which group of the virus is likely?", "options": [{"label": "A", "text": "Togaviruses", "correct": true}, {"label": "B", "text": "Enteroviruses", "correct": false}, {"label": "C", "text": "Herpes viruses", "correct": false}, {"label": "D", "text": "Reoviruses", "correct": false}], "correct_answer": "A. Togaviruses", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Togaviruses Rubella virus is the only member of the togavirus family that causes significant disease in humans—German measles. Rubella virus is classified as a togavirus and is the only member of the genus Rubivirus. Rubella (German measles) is a common mild disease characterized by a rash. It affects children and adolescents worldwide and can also affect young adults. Congenital rubella syndrome, PDA, peripheral pulmonary stenosis. It is caused by the rubella virus, which is a member of the Rubivirus genus. White pupils due to congenital cataracts in a child with congenital rubella syndrome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Rubella is a contagious disease caused by a virus. Most people who get rubella usually have a mild illness, with symptoms that can include a low-grade fever, sore throat, and a rash that starts on the face and spreads to the rest of the body. The age group most prone to Rubella is:", "options": [{"label": "A", "text": "Children (3-10 years)", "correct": true}, {"label": "B", "text": "Adolescent girls", "correct": false}, {"label": "C", "text": "Pregnant females", "correct": false}, {"label": "D", "text": "Women of childbearing age", "correct": false}], "correct_answer": "A. Children (3-10 years)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Children (3-10 years) Unvaccinated young children are at the highest risk. Age-specific attack rates may be highest in susceptible infants younger than 12 months, school-aged children, or young adults, depending on local immunization practices and the incidence of the disease. People who are at high risk for complications are infants and children aged less than 5 years; adults aged over 20 years; Followed by pregnant women; people with compromised immune systems, such as from leukemia, HIV infection, or innate immunodeficiency; and those who are malnourished or have vitamin A deficiency.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Recommended Rubella vaccination strategy – to be given first and foremost for:", "options": [{"label": "A", "text": "Women (15-49 years)", "correct": true}, {"label": "B", "text": "Infants", "correct": false}, {"label": "C", "text": "Children (1-14 years)", "correct": false}, {"label": "D", "text": "Adolescent girls", "correct": false}], "correct_answer": "A. Women (15-49 years)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Women (15-49 years) For the elimination of rubella and CRS (CONGENITAL RUBELLA SYNDROME), the preferred approach is, to begin with the MR vaccine or MMR vaccine in a campaign targeting a wide range of ages . All subsequent follow-up campaigns should use the MR vaccine or MMR vaccine.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B and C. There are two general approaches to the use of the rubella vaccine: T he first focuses exclusively on reducing CRS by immunizing adolescent girls and/or women of childbearing age; the second approach aims at interrupting viral transmission and thereby eliminating rubella as well as CRS. Options B, C, and D . Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Countries with high rates of immunization no longer see cases of rubella or congenital rubella syndrome. All true about the Rubella vaccine except:", "options": [{"label": "A", "text": "The vaccine prevents reinfection, thereby limiting the spread of the virulent virus", "correct": false}, {"label": "B", "text": "The immunogen in the vaccine is killed Rubella virus", "correct": true}, {"label": "C", "text": "The vaccine induces antibodies that prevent dissemination of the virus by neutralizing it during the viremic stage", "correct": false}, {"label": "D", "text": "The incidence of child Rubella and the congenital. Rubella syndrome has decreased significantly since the advent of the vaccine", "correct": false}], "correct_answer": "B. The immunogen in the vaccine is killed Rubella virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The immunogen in the vaccine is killed Rubella virus Rubella can be prevented with the MMR vaccine. This protects against three diseases: measles, mumps, and rubella. CDC recommends children get two doses of MMR vaccine, starting with the first dose at 12 through 15 months of age, and the second dose at 4 through 6 years of age. Rubella vaccine is usually given as part of a combination vaccine called MMR, which protects against three diseases: measles, mumps, and rubella. MMR vaccine is safe and effective and has been widely used for more than 30 years.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Rubella vaccine is a vaccine used to prevent rubella. Effectiveness begins about two weeks after a single dose. The rubella virus is an enveloped, single-stranded RNA virus with a single antigen or serotype. It does not cross-react with other togaviruses. R ubella virus is inactivated by lipid Infec tion may lead to fetal death, RA 27/3 rubella vaccine is safe and more immunogenic. MMR is an attenuated (weakened) live virus vaccine. This means that after injection, the viruses cause a harmless infection in the vaccinated person with very few if any, symptoms before they are eliminated from the body. Option C. The vaccine induces antibodies that prevent dissemination of the virus by neutralizing it during the viremic stage - True Option D. The incidence of child Rubella and the congenital Rubella syndrome has decreased significantly since the advent of the vaccine - True Option A , C and D. Are true about rubella.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Traditional vaccination for the common cold is virtually impossible because there are multiple serotypes of which one of the following viruses?", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": false}, {"label": "B", "text": "Mumps", "correct": false}, {"label": "C", "text": "Rabies", "correct": false}, {"label": "D", "text": "Rhinovirus", "correct": true}], "correct_answer": "D. Rhinovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rhinovirus Rhinovirus has been classified into three species: RV-A (80 serotypes), RV-B (32 serotypes), and RV-C (55 serotypes). Serotype and species classifications are determined primarily by nucleotide sequence identity. Rhinovirus (rhino means \"nose\") infections cause the common cold. Rhinoviruses may also cause sore throats, ear infections, and infections of the sinuses (openings in the bone near the nose and eyes). T hey may also cause pneumonia and bronchiolitis, but this is less common. Therefore, it is nearly impossible to identify the most important serotypes that have to be covered by a possible vaccine. There are no vaccines against these viruses as there is little-to-no cross-protection between serotypes. At least 99 serotypes of human rhinoviruses affecting humans have been sequenced.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Cytomegalovirus is a genus of viruses in the order Herpesvirales, in the family Herpesviridae, in the subfamily Betaherpesvirinae. Humans and monkeys serve as natural hosts. The 11 species in this genus include human betaherpesvirus 5, which is the species that infects humans. Option B. Mumps affects the parotid glands, salivary glands below and in front of the ears. The disease spreads through infected saliva. Option C. Rabies is a preventable viral disease most often transmitted through the bite of a rabid animal. The rabies virus infects the central nervous system of mammals, ultimately causing disease in the brain and death. Options A, B, and C. Are not associated with common cold infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A poliovirus, the causative agent of polio, is a serotype of the species Enterovirus C, in the family of Picornaviridae. There are three poliovirus serotypes: types 1, 2, and 3. Poliovirus is composed of an RNA genome and a protein capsid. The primary pathological effect of poliovirus infection is a result of which of the following:", "options": [{"label": "A", "text": "Destruction of infected cells", "correct": true}, {"label": "B", "text": "Paralysis of muscle cells", "correct": false}, {"label": "C", "text": "Immune complex formation", "correct": false}, {"label": "D", "text": "Aseptic meningitis", "correct": false}], "correct_answer": "A. Destruction of infected cells", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Destruction of infected cells The virus may spread to the posterior horn cells, motor neurons of the thalamus, and hypothalamus. In the bulbar form of poliomyelitis, there is the involvement of the brain stem, which may be fatal. The histological appearance of the affected brain cells shows v acuolation and infiltration.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Poliovirus infects human cells by binding to an immunoglobulin-like receptor, CD155 (also known as the poliovirus receptor or PVR) on the cell surface. The interaction of poliovirus and CD155 facilitates an irreversible conformational change of the viral particle necessary for viral entry. Lysis of the infected cell results in the release of infectious progeny virions. Option C. Poliovirus infects human cells by binding to an immunoglobulin-like receptor. Option D. Infected cells get phagocytosed by macrophages causing degeneration of axons. Options B, C, and D. Occur at a later stage of disease progression.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements best describes an advantage of the oral polio vaccine when compared to the inactivated poliomyelitis vaccine?", "options": [{"label": "A", "text": "It can be administered to immunocompromised patients", "correct": false}, {"label": "B", "text": "It is not associated with vaccine-related cases of poliomyelitis", "correct": false}, {"label": "C", "text": "It induces local intestinal immunity", "correct": true}, {"label": "D", "text": "It is easily administered as a series of multiple injections", "correct": false}], "correct_answer": "C. It induces local intestinal immunity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It induces local intestinal immunity OPVs are safe and effective and offer long-lasting protection against the serotype(s) that they target. OPV stimulates good mucosal immunity, which is why it is so effective at interrupting the transmission of the virus. OPV is given orally, protecting the mouth, in the intestines, and then in the blood. Protection in the mouth and intestines are important as polioviruses infect the mouth and multiply in the intestines.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The action of the oral polio vaccine (OPV) is two-pronged. OPV produces antibodies in the blood ('humoral' or serum immunity) to all three types of poliovirus. O PV strains also produce a local immune response in the lining ('mucous membrane') of the intestines - the primary site for poliovirus multiplicatio n Options A, B, and D. Are not the correct statements.</p>\n<p><strong>Extraedge:</strong></p><p>Also, Remember Polio serotypes: Type 1 MC serotype to cause epidemics. Only serotype that is endemic currently in the world. Type 2 Most antigenic and hence easiest serotype to be eradicated. No natural case since 1999. Option B. MC serotype found among th e VDPV strain Type 3 No natural case since 2013. MC serotype to cause VAPP</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The use of live oral polio vaccines has been replaced by inactivated polio vaccines in many countries. What is the primary reason?", "options": [{"label": "A", "text": "It is more cost-effective to use the inactivated vaccine", "correct": false}, {"label": "B", "text": "There is a greater risk of vaccine-induced disease than a wild-virus-induced disease in areas where polio has been eradicated", "correct": true}, {"label": "C", "text": "Only a single dose of inactivated vaccine is necessary compared with multiple doses of the oral vaccine", "correct": false}, {"label": "D", "text": "Circulating poliovirus strains have changed and the live vaccine is no longer effective", "correct": false}], "correct_answer": "B. There is a greater risk of vaccine-induced disease than a wild-virus-induced disease in areas where polio has been eradicated", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>There is a greater risk of vaccine-induced disease than a wild-virus-induced disease in areas where polio has been eradicated At least one dose of IPV must be introduced, given in addition to OPV, to protect against type 2 poliovirus and to boost population immunity. The switch from tOPV to bOPV will reduce the risk of vaccine-associated polio and increase protection from types 1 and 3 polioviruses.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. An increasing number of industrialized, polio-free countries are using IPV as the vaccine of choice. Option C. This is because the risk of paralytic polio associated with continued routine use of OPV is deemed greater than the risk of imported wild viruses. Option D. To maintain immunity levels to type 2 polio, high-risk countries introduced IPV into routine immunization programs before the switch. Options A, C, and D . Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Live, attenuated OPV, and inactivated polio vaccine are both available. In which of the following is OPV preferred?", "options": [{"label": "A", "text": "Routine infant vaccination", "correct": false}, {"label": "B", "text": "Mass immunization programs in areas of high polio endemicity", "correct": true}, {"label": "C", "text": "Adult immunization", "correct": false}, {"label": "D", "text": "Patience on immunosuppressive therapy", "correct": false}], "correct_answer": "B. Mass immunization programs in areas of high polio endemicity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mass immunization programs in areas of high polio endemicity IPV is also more expensive and more difficult to administer than OPV. OPV, on the other hand, provides better mucosal immunity than IPV, but because it's a live virus, it can replicate and revert to a neurovirulent form that endangers its host and could fuel outbreaks. The action of the oral polio vaccine (OPV) is two-pronged . OPV produces antibodies in the blood ('humoral' or serum immunity) to all three types of poliovirus, and in the event of infection, this protects the individual against polio paralysis by preventing the spread of poliovirus to the nervous system.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following properties of enteroviruses is not shared by rhinoviruses?", "options": [{"label": "A", "text": "Single-stranded RNA genome", "correct": false}, {"label": "B", "text": "Resistance to lipid solvents", "correct": false}, {"label": "C", "text": "Stability at acidic pH", "correct": true}, {"label": "D", "text": "Icosahedral symmetry", "correct": false}], "correct_answer": "C. Stability at acidic pH", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Stability at acidic pH HRVs, members of the family Picornaviridae, and the genus Enterovirus are positive-sense, single-stranded-RNA (ssRNA) viruses of approximately 7,200 bp. The viral genome consists of a single gene whose translated protein is cleaved by virally encoded proteases to produce 11 proteins. However, despite their common genomic features, these 2 groups of viruses have different phenotypic characteristics. In vivo, rhinoviruses are restricted to the respiratory tract, whereas enteroviruses infect primarily the gastrointestinal tract and can spread to other sites such as the central nervous system. HRVs and HEVs present different optimal growth temperatures in vitro. Furthermore, compared to HEVs, HRVs are sensitive to acidic pH and do not survive the gastrointestinal acidic environment.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and Are common between rhinovirus and enterovirus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Post-exposure vaccination is given for which of the following?", "options": [{"label": "A", "text": "Measles", "correct": false}, {"label": "B", "text": "Polio", "correct": false}, {"label": "C", "text": "Rabies", "correct": true}, {"label": "D", "text": "Chickenpox", "correct": false}], "correct_answer": "C. Rabies", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rabies Post-exposure vaccination is given for rabies. Tissue culture vaccines are available. The first cell-cultured vaccine was the human diploid cell vaccine. Now more economical vaccines have been developed – primary cell culture vaccine grown on chick embryo and continuous cell culture vaccine grown on vero cell line. For polio, Measles, and Chickenpox preexposure prophylaxis is done.</p>\n<p><strong>Highyeild:</strong></p><p>Schedule of PEP regimen: ID regimens are cost-effective; dose-sparing and time-sparing and therefore are preferred over IM regimens ID PEP regimen (2-2-2): 2-site ID vaccine is given on days 0, 3 and 7 IM PEP regimens: A total of four doses are given. Two schedules are available 1-site IM vaccine given on days 0, 3, 7, and the fourth dose between days 14 to 28 or A 2-site IM vaccine was given on day 0 and 1-site IM on days 7 and 21. This gives protection for at least 5 years, during which period any further exposure may need 1/2 booster doses.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- So, Options A, B, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient Presented to the hospital with severe hydrophobia. Intracytoplasmic eosinophilic inclusion bodies with basophils inner granules are seen on cerebellum stains after post-mortem. What is the probable diagnosis?", "options": [{"label": "A", "text": "Rabies", "correct": true}, {"label": "B", "text": "Herpes Encephalitis", "correct": false}, {"label": "C", "text": "Botulism", "correct": false}, {"label": "D", "text": "Chickenpox", "correct": false}], "correct_answer": "A. Rabies", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rabies It is an intracytoplasmic eosinophilic inclusion with characteristic basophilic inner granules, composed of rabies virus proteins and viral RNA. Histological stains such as H and E and Sellers stains are commonly used to demonstrate them. Negri body detection is pathognomonic of rabies. However, it may not be detected in 20% of cases. intracytoplasmic inclusion bodies</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C, B, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Influenza is a viral infection that attacks the respiratory system — nose, throat, and lungs. Influenza is commonly called the flu, but it's not the same as stomach \"flu\" viruses that cause diarrhea and vomiting. For most people, the flu resolves on its own. Influenza virus is cultured on:", "options": [{"label": "A", "text": "Egg inoculation", "correct": false}, {"label": "B", "text": "Yolk sac", "correct": false}, {"label": "C", "text": "Amniotic cavity", "correct": true}, {"label": "D", "text": "Chorioallantoic membrane", "correct": false}], "correct_answer": "C. Amniotic cavity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Amniotic cavity For primary isolation of the influenza virus amniotic cavity is used, but the allantoic cavity can be used after adaptation. Amniotic sac: Used for the isolation of influenza virus</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Animal Inoculation- Because of the ethical issues related to the use of animals, animal inoculation is largely restricted only for research purposes. Option B. Yolk sac inoculation: Used for arboviruses (e.g. JE virus) and some bacteria such as Rickettsia, Chlamydia, and Haemophilus ducreyi Allantoic sac: It is a larger cavity, hence is used for better yield of viral vaccines such as influenza vaccine, yellow fever (17D) vaccine, rabies (Flury strain) Option D. Chorioallantoic membrane: Used for the isolation of poxviruses (e.g. vaccinia and variola). They produce visible lesions over the chorioallantoic membrane called pocks. So, Options A, B, and Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A retrovirus is a virus that uses RNA as its genetic material. Upon infection with a retrovirus, a cell converts the retroviral RNA into DNA, which in turn is inserted into the DNA of the host cell. The cell then produces more retroviruses, which infect other cells. Retrovirus causes:", "options": [{"label": "A", "text": "Burkitt's lymphoma", "correct": false}, {"label": "B", "text": "Human T cell leukemia", "correct": true}, {"label": "C", "text": "Encephalitis", "correct": false}, {"label": "D", "text": "Uveal melanoma", "correct": false}], "correct_answer": "B. Human T cell leukemia", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Human T cell leukemia HTLV belongs to the family retroviridae (Subfamily: Lentivirinae) as it contains reverse transcriptase (RNA-directed DNA polymerase) enzyme. It contains two copies of positive-sense single-stranded RNA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Burkitt's lymphoma- Epstein Barr virus (Herpesviridae) Option C. Encephalitis is most often due to a virus, such as herpes simplex viruses, which causes cold sores (this is the most common cause of encephalitis) the varicella-zoster virus, which causes chickenpox and shingles. Option D. Uveal melanoma of the iris is usually a small tumor that grows slowly and rarely spreads to other parts of the body. Uveal melanoma of the ciliary body and choroid are usually larger tumors and are more likely to spread to other parts of the body. So, Options A, C, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In a person with HIV-1 infection, which of the following is the most predictive of the patient's prognosis?", "options": [{"label": "A", "text": "CD4+ cell count", "correct": false}, {"label": "B", "text": "CD4:CD8 cell ratio", "correct": false}, {"label": "C", "text": "Degree of lymphadenopathy", "correct": false}, {"label": "D", "text": "Level of HIV-1 RNA in plasma", "correct": true}], "correct_answer": "D. Level of HIV-1 RNA in plasma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Level of HIV-1 RNA in plasma The plasma viral load appears to be the best predictor of long-term clinical outcome, whereas CD4 lymphocyte counts are the best predictor of short-term risk of developing an opportunistic disease. Plasma viral load measurements are a critical element in assessing the e ffectiveness of antiretroviral drug therapy. There are continual rounds of viral replication and cell killing in each patient, and the steady-state level of the virus in the blood varies with the individual.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "AIDS symptoms include weight loss, fever or night sweats, fatigue, and recurrent infections. A patient comes with a history of sore throat, diarrhea, and sexual contact 2 weeks before. The best investigation to rule out HIV is-", "options": [{"label": "A", "text": "p24 antigen assay", "correct": true}, {"label": "B", "text": "ELISA", "correct": false}, {"label": "C", "text": "Western blot", "correct": false}, {"label": "D", "text": "Lymph node biopsy", "correct": false}], "correct_answer": "A. p24 antigen assay", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>p24 antigen assay The patient would likely be in the window period (serology negative) . Hence best investigation would be the p24 antigen assay. Testing for antibodies needs to be done only after 2 to 6 months to ascertain whether the infection has occurred or not after a single sexual exposure.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. The most common HIV tests use blood to detect HIV infection. The enzyme-linked immunosorbent assay (ELISA) tests a patient's blood sample for antibodies. Option C. The Western blot test separates the blood proteins and detects the specific proteins (HIV antibodies) that indicate an HIV infection. The Western blot is used to confirm a positive ELISA, and the combined tests are 99.9% accurate. Option D. A lymph node biopsy can confirm a diagnosis of AIDS-related lymphoma and identify the type. So, Options C, B, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Which Rickettsia is not transmitted by an arthropod vector:", "options": [{"label": "A", "text": "R. Prowazeki", "correct": false}, {"label": "B", "text": "R. Tsutsugamushi", "correct": false}, {"label": "C", "text": "Coxiella burnetii", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Coxiella burnetii", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxiella burnetii It is transmitted by aerosol in humans. Coxiella burnetii is an obligate intracellular bacterial pathogen and is the causative agent of Q fever.</p>\n<p><strong>Highyeild:</strong></p><p>C. urnetii transmission is unique among Rickettsial species in that it is not dependent on an arthropod vector. C. burnetii infects a number of mammals and its spores are released in a number of secretions, particularly the placenta.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - R. Prowazeki is transmitted by louse which is an arthropod vector hence option A is incorrect Option B - R. Tsutsugamushi is transmitted by Mite which is also an arthropod vector, hence Option B is also incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>Coxiella burnetii belongs to the γ subdivision of the class Proteobacteria 4 . It is a pleomorphic, Gram-negative, spore-forming coccobacillus 1 4 5 . It is an obligate intracellular pathogen, and completes its development cycle in the phagolysosome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True statements about Rickettsia are:", "options": [{"label": "A", "text": "Gram-negative but stained with Castaneda stain", "correct": true}, {"label": "B", "text": "Acidophilic inclusion bodies epidemic typhus is caused by R.typhi.", "correct": false}, {"label": "C", "text": "Contains DNA but no RNA", "correct": false}, {"label": "D", "text": "The drug of choice is sulphonamide", "correct": false}], "correct_answer": "A. Gram-negative but stained with Castaneda stain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gram-negative but stained with Castaneda stain Rickettsia is bacteria which are obligate intracellular parasites. The cells are extremely small rod-shaped, coccoid and often pleomorphic microorganisms which have typical bacterial cell walls, no flagella, are gram-negative and multiply via binary fission only inside host cells. They are Gram-negative, though they do not take the stain well. They stain bluish purple with Giemsa and Castaneda (option A).</p>\n<p><strong>Highyeild:</strong></p><p>They are gram-negative though do not take stain well. They stain deep red with Machiavello and Gimenez while bluish purple with Giemsa and Castaneda stains. They generally grow in the cytoplasm of infected cells but spotted fever rickettsiae grow in the nucleus as well.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. The inclusion bodies are not acidophilic hence option B is not true Option C. Rickettsia are pleomorphic obligate intracellular parasites , they contain both RNA in ribosomes and DNA , and they divide by binary fission. Hence option C is not true Option D. Tetracyclines especially doxycycline are effective in the treatment of rickettsia whereas Sulphonamides enhance the disease and are contraindicated hence option D is also not true.</p>\n<p><strong>Extraedge:</strong></p><p>The rickettsiae are a diverse collection of obligately intracellular Gram-negative bacteria found in ticks, lice, fleas, mites, chiggers, and mammals. They include the genera Rickettsiae, Ehrlichia, Orientia, and Coxiella.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following rickettsial disease is spread by tick bite:", "options": [{"label": "A", "text": "Epidemic typhus", "correct": false}, {"label": "B", "text": "Rocky Mountain spotted fever", "correct": true}, {"label": "C", "text": "Rickettsialpox", "correct": false}, {"label": "D", "text": "Scrub typhus", "correct": false}], "correct_answer": "B. Rocky Mountain spotted fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rocky Mountain spotted fever Rocky Mountain spotted fever is a bacterial infection transmitted by a tick. Rocky Mountain spotted fever (RMSF) is a bacterial disease spread by ticks.</p>\n<p><strong>Highyeild:</strong></p><p>Rickettsialpox is a rickettsial disease that is caused by Rickettsia akari and spread by chiggers (mite larva) or adult mites. Symptoms of rickettsialpox, which are mild, include a fever with chills and sweating, a headache, sensitivity to light, muscle pains, and a rash.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - Epidemic Typhus aka Louse-borne typhus is caused by R. Prowazeki, as the name suggests it is spread by Louse hence option A is incorrect. Epidemic typhus is spread to people through contact with infected body lice. Option C - Pox is caused by Rickettsia Akari and spread by mite larvae or adult mites. Symptoms of rickettsialpox, which are mild, include a fever with chills and sweating, a headache, sensitivity to light, muscle pains, and a rash Option D - Scrub Typhus caused by Orientia Tsutsugamushi is spread by mites hence option D is also incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>Rickettsii (Rocky Mountain spotted fever [RMSF], also known as Brazilian spotted fever); R. typhi (murine typhus); Orientia tsutsugamushi (scrub typhus); and Anaplasma phagocytophilum (anaplasmosis). Many other rickettsial agents cause human infections across the globe, but the true burden remains undetermined.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Weil Felix test is useful in the diagnosis of the following except:", "options": [{"label": "A", "text": "Epidemic typhus", "correct": false}, {"label": "B", "text": "Scrub typhus", "correct": false}, {"label": "C", "text": "RMSF", "correct": false}, {"label": "D", "text": "Trench fever", "correct": true}], "correct_answer": "D. Trench fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trench fever Trench fever is a louse-borne disease caused by the gram-negative bacterium Bartonella quintana and observed originally in military populations during World Wars I and II. Symptoms are an acute, recurring febrile illness, occasionally with a rash. Diagnosis is by blood culture.</p>\n<p><strong>Highyeild:</strong></p><p>The Weil–Felix test is an agglutination test for the diagnosis of rickettsial infections. The Weil-Felix test detects typhus and specific rickettsial infections. Rickettsia is bacteria transmitted by ticks, fleas, and lice. Weil-Felix is a nonspecific agglutination test which detects anti-rickettsial antibodies in a patient's serum. Weil-Felix test is based on cross-reactions which occur between antibodies produced in acute rickettsial infections with antigens of OX (OX 19, OX 2, and OXK) strains of Proteus species.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Epidemic Typhus which is caused by R. Prowazekii reacts with P. Vulagaris OX19 hence it's incorrect Option B. Scrub typhus reacts with OXK in Weil – Felix test hence option B is also incorrect Option C. Rocky Mountain Spotted Fever is caused by R. Rickettsii, R. Africae and R. Japonica etc and reacts with OX2 and OX19 to varying degrees depending upon the species.</p>\n<p><strong>Extraedge:</strong></p><p>Weil-Felix Reaction- A Heterophile Agglutination Test A Weil-Felix reaction is a type of agglutination test in which patients serum is tested for agglutinins to O antigen of certain non-motile Proteus and rickettsial strains (OX19, OX2, OXK) OX19, OX2 are strains of Proteus vulgaris. OXK is the strain of Proteus mirabilis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which Rickettsia exhibits phase variation:", "options": [{"label": "A", "text": "R. Quintana", "correct": false}, {"label": "B", "text": "Coxiella burnetii", "correct": true}, {"label": "C", "text": "R. akari", "correct": false}, {"label": "D", "text": "R prowazekii", "correct": false}], "correct_answer": "B. Coxiella burnetii", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxiella burnetii Coxiella burnetii is an obligate intracellular bacterial pathogen and is the causative agent of Q fever. The genus Coxiella is morphologically similar to Rickettsia but with a variety of genetic and physiological differences.</p>\n<p><strong>Highyeild:</strong></p><p>Phase variation of Coxiella burnetii is due to variation of the lipopolysaccharide (LPS), a phenomenon analogous to smooth-to-rough LPS variation of gram-negative enteric bacteria. Like gram-negative enterobacteria, smooth LPS phase variants of C. burnetii are virulent, whereas rough LPS variants are avirulent. Phase I is the virulent form that is found in humans with Q fever and infected vertebrate animals. It is the infectious form of the organism and the lipopolysaccharide expressed during this phase appears to be a key virulence factor. Phase II forms are not infectious and occur only by serial passage in cell cultures. Patients with clinical illness mount antibodies to both phase I and phase II antigens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Bartonella quintana, originally known as Rochalimaea quintana, and \"Rickettsia quintana\", is a bacterium transmitted by the human body louse that causes trench fever. Option C. R. akari causes rocky mountain spotted fever and does not exhibit phase variation. Option D. R prowazekii does not exhibit variation.</p>\n<p><strong>Extraedge:</strong></p><p>Coxiella burnetii is an obligate intracellular bacterial pathogen, and is the causative agent of Q fever.[1] The genus Coxiella is morphologically similar to Rickettsia, but with a variety of genetic and physiological differences. C. burnetii is a small Gram-negative, coccobacillary bacterium that is highly resistant to environmental stresses such as high temperature, osmotic pressure, and ultraviolet light. These characteristics are attributed to a small cell variant form of the organism that is part of a biphasic developmental cycle, including a more metabolically and replicatively active large cell variant form.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which one of the following is transmitted by the bite of the organism shown in the pictograph?", "options": [{"label": "A", "text": "B. (Rochalimaea) henselae", "correct": false}, {"label": "B", "text": "C. trachomatis", "correct": false}, {"label": "C", "text": "C. burnetii", "correct": false}, {"label": "D", "text": "E. chaffeensis", "correct": true}], "correct_answer": "D. E. chaffeensis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504498590-QTDV007008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>E. chaffeensis The given image is of a Hard Ixodes tick. Ehrlichia chaffeensis is transmitted through the saliva of the A. americanum tick vector tick. (hard Ixodes tick) E. chaffeensis can be transmitted to uninfected tick larvae when feeding on the blood from an infected host. The infection is then maintained and can be transmitted to a reservoir organism or humans at the nymphal stage.</p>\n<p><strong>Highyeild:</strong></p><p>Ehrlichia chaffeensis is an obligately intracellular, tick-transmitted bacterium that is maintained in nature in a cycle involving at least one and perhaps several vertebrate reservoir hosts. Ehrlichiosis is caused by Ehrlichia bacteria and is transmitted primarily by the Lone Star tick.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Bartonella Henselae also known as cat scratch disease and is transmitted from a cat to a person during a scratch hence it’s not correct Option B. Chlamydia Tachomatis is most commonly transmitted through unprotected vaginal, oral and anal sex. Pregnant women can also transmit it to their newborns Option C. Coxiella Burnetti causes Q fever which naturally infects animals such as goats, cattle and sheep etc hence it is not the correct option</p>\n<p><strong>Extraedge:</strong></p><p>Diseases Caused By Hard Tick</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 16-year-old girl presents with a painless enlarged lymph node in her right axilla. Peripheral blood counts are within normal limits. The lymph node is biopsied, and numerous granulomas filled with neutrophils and necrotic debris are observed. Which organism could produce this disease?", "options": [{"label": "A", "text": "Bartonella henselae", "correct": true}, {"label": "B", "text": "Borrelia burgdorferi", "correct": false}, {"label": "C", "text": "Chlamydia psittaci", "correct": false}, {"label": "D", "text": "Coxiella burnetii", "correct": false}], "correct_answer": "A. Bartonella henselae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bartonella henselae Cat scratch disease is an infection that causes swelling of the lymph nodes after being infected by Bartonella henselae, the bacteria that cause this disease. Cat scratch disease (CSD), also called cat scratch fever, is a bacterial infection caused by Bartonella henselae, which is generally spread to people through cat bites or scratches. Most healthy people do not develop any symptoms, and those with mild infections usually get better without any treatment.</p>\n<p><strong>Highyeild:</strong></p><p>Bartonella henselae Infection is an enlarged lymph node in the armpit region of a person with cat-scratch disease, and partially healed wounds from a cat scratch on the hand. Cat-scratch disease (CSD) is a bacterial infection spread by cats.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Borrelia burgdorferi causes Lyme Disease which has 3 stages:- Stage 1- skin lesion The lesion, erythema migrans, begins as a flat reddened area near the tick bite and slowly expands, with central clearing. With the skin lesion, there is often a flu like illness with fever, chills, myalgia, and headache. Hence it's incorrect. Option C. The onset is usually sudden, with malaise, fever, anorexia, sore throat, photophobia, and severe headache. The disease may progress no further, and the patient may improve in a few days. In severe cases, the signs and symptoms of bronchial pneumonia appear at the end of the first week of the disease. The clinical picture often resembles that of influenza, nonbacterial pneumonia, or typhoid fever. Hence incorrect. Option D. C.B urnetii causes Q fever. Infections may be acute or chronic. The acute disease resembles influenza, nonbacterial pneumonia, and hepatitis. There is a rise in the titer of specific antibodies to C burnetiid. Hence Incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>While most infections clear up spontaneously, treatment with tetracycline or doxycycline appears to reduce the symptomatic duration and reduce the likelihood of chronic infection. A combination of erythromycin and rifampin is highly effective in curing the disease, and vaccination with Q-VAX vaccine (CSL) is effective for prevention of it.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Bartonella henselae causes all except.", "options": [{"label": "A", "text": "Oroya fever", "correct": true}, {"label": "B", "text": "Cat scratch disease", "correct": false}, {"label": "C", "text": "Bacillary angiomatosis", "correct": false}, {"label": "D", "text": "SABE Subacute bacterial endocarditis", "correct": false}], "correct_answer": "A. Oroya fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oroya fever Oroya fever and verruga peruana are infections caused by the gram-negative bacterium Bartonella bacilliformis .</p>\n<p><strong>Highyeild:</strong></p><p>Oroya fever occurs after initial exposure; verruga peruana occurs after recovery from the primary infection. Oroya fever sometimes known as Carrion's disease is a bacterial infection caused by the Bartonella bacilliformis bacteria.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Cat scratch disease ( CSD), also called cat scratch fever, is a bacterial infection caused by Bartonella henselae , which is generally spread to people through cat bites or scratches. Option C. Bacillary angiomatosis is caused by two species of Bartonella genus namely Bartonella henselae and Bartonella quintana. The clinical spectrum of bacillary angiomatosis caused by these species differs. Option D. Subacute bacterial endocarditis is a type of infective endocarditis. It's an infection that occurs when germs such as bacteria enter the bloodstream and attack the lining of the heart valves. This causes growths, called vegetation, on the heart valves. subacute bacterial endocarditis is often caused by a particular group of streptococci bacteria that usually live in your mouth and throat. Normally, your immune system destroys any harmful bacteria that enter your bloodstream. Under certain circumstances, these bacteria can cause endocarditis.</p>\n<p><strong>Extraedge:</strong></p><p>Bartonella henselae is a Gram-negative rod. It can be cultured in a lysis-centrifugation blood culture. The presence of bacteria can be detected by Warthin-Starry stain, or by a similar silver stain technique performed on infected tissue. A pan-Bartonella PCR detection is non-invasive and uses blood or biopsies to diagnose.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A forest guard of Uttarakhand had myalgia for a few days. He came to OPD and was given ceftriaxone. He later deteriorates and comes back with a lesion in the armpit. What is the diagnosis?", "options": [{"label": "A", "text": "KFD Kyasanur Forest disease", "correct": false}, {"label": "B", "text": "Scrub typhus", "correct": true}, {"label": "C", "text": "Cutaneous anthrax", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "B. Scrub typhus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504500321-QTDV007012IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Scrub typhus The given image is of a Trombiculid mite which is a vector of Scrub Typhus Scrub typhus results in a classic triad of fever, myalgia, and headache. Symptoms usually start within 6–14 days of being bitten. In most cases, a cutaneous eschar develops at the site of inoculation. Lymphadenopathy is common, and a maculopapular rash may occur on the trunk (exanthem).</p>\n<p><strong>Highyeild:</strong></p><p>Scrub Typhus, also known as Tsutsugamushi Disease, is caused by Orienta Tsutsugamushi bacteria . It is a zoonosis (an animal disease that can spread to humans) primarily affecting rodents, rabbits, and marsupials. The disease is transmitted to humans by the bite of a larval-stage trombiculid mite or chigger . It shows a chigger that can be seen only with a magnifying glass. Humans are accidental hosts in this re-emerging zoonotic disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. KFD (Kyasanur Forest Disease) aka Monkey Disease was discovered in Karnataka, India and is limited to the Southern part of India also no lesion in the armpit is seen in KFD hence it is incorrect Option C. Cutaneous Anthrax causes small blisters or bumps that may itch most commonly on the face, neck, arms and hands hence it is incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Peripheral blood smear of a patient with relapse of a fever seven days after remittance is shown in the image. True statement about the etiological agent:", "options": [{"label": "A", "text": "The only reservoir is humans", "correct": false}, {"label": "B", "text": "Vector is a hard tick or body louse", "correct": false}, {"label": "C", "text": "It is non-cultivable on cell-free media.", "correct": false}, {"label": "D", "text": "Soft ticks or body louse can transmit the disease", "correct": true}], "correct_answer": "D. Soft ticks or body louse can transmit the disease", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504500641-QTDV007013IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Soft ticks or body louse can transmit the disease The given image shows spirochetes with large irregular and wide open coils which is characteristic of Borrelia species and the given scenario points towards a diagnosis of Relapsing fever.</p>\n<p><strong>Highyeild:</strong></p><p>Borrelia bacteria that cause TBRF are transmitted to humans through the bite of infected \"soft ticks\" of the genus Ornithodoros. Soft ticks differ in two important ways from the more familiar \"hard ticks\". A soft-bodied tick (Ornithodoros) transmits multiple Borrelia species that cause endemic relapsing fever, whereas the human body louse transmits B recurrentis, which causes an epidemic form of relapsing fever. Relapsing fever is a vector-borne disease caused by infection with certain bacteria in the genus Borrelia, which is transmitted through the bites of lice or soft-bodied ticks.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Main Reservoir for Ornithodoros is rodents, relapsing Fever is endemic to many parts sof the world Option B. From the question we can deduce that the etiological agent is Ornithodoros which is the soft tick hence it is incorrect Option C. is incorrect as the organism can be cultured in fluid media containing blood, serum or tissue, but it loses its pathogenicity rapidly when transferred repeatedly in-vitro.</p>\n<p><strong>Extraedge:</strong></p><p>There are three stages of Lyme disease: Stage 1 is called early localized Lyme disease. The bacteria have not yet spread throughout the body. Stage 2 is called early disseminated Lyme disease. The bacteria have begun to spread throughout the body. Stage 3 is called late disseminated Lyme disease.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following rickettsial disease is/are spread by mites: Epidemic typhus Rocky Mountain spotted fever Rickettsial pox Scrub typhus Select the correct answer from the given below code:", "options": [{"label": "A", "text": "A & B", "correct": false}, {"label": "B", "text": "B & C", "correct": false}, {"label": "C", "text": "C & D", "correct": true}, {"label": "D", "text": "D & A", "correct": false}], "correct_answer": "C. C & D", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>C & D Rickettsial pox and Scrub typhus are transmitted by mites. Rickettsia is a genus of nonmotile , Gram - negative , non-spore-forming, highly pleomorphic bacteria that may occur in the forms of cocci, bacilli, or threads.</p>\n<p><strong>Highyeild:</strong></p><p>Rickettsial infections and related infections (such as anaplasmosis, ehrlichiosis, and Q fever ) are caused by an unusual type of bacteria that can live only inside the cells of another organism. Most of these infections are spread through ticks, mites, fleas, or lice. Rickettsial disease encompasses a group of diseases caused by the microorganisms, rickettsiae. Rickettsiae are bacteria that can only survive inside cells. Rickettsial diseases (rickettsioses) and related diseases anaplasmosis, ehrlichiosis, Q fever, scrub typhus are caused by a group of gram-negative organisms.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option. A is incorrect as epidemic typhus includes R. prowazekii and R. Typhi infections which are caused by louse and fleas respectively Option. B is incorrect as Rocky Mountain Spotted Fever includes Ricketsii, R. conoriii and R. Sibirica infection all caused by ticks.</p>\n<p><strong>Extraedge:</strong></p><p>Rocky Mountain spotted fever is a potentially fatal disease that's usually caused by the bite of a tick infected with rickettsia group bacteria. Symptoms include fever, headache and muscle aches. A rash may be present, frequently with blackened or crusted skin at the site of a tick bite. Spotted fever responds well to prompt treatment with antibiotics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which Rickettsia is not transmitted by an arthropod vector:", "options": [{"label": "A", "text": "R. prowazeki", "correct": false}, {"label": "B", "text": "O. Tsutsugamushi", "correct": false}, {"label": "C", "text": "Coxiella burnetii", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Coxiella burnetii", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxiella burnetii Coxiella burnetii is an obligate intracellular bacterial pathogen and is the causative agent of Q fever. The genus Coxiella is morphologically similar to Rickettsia but with a variety of genetic and physiological differences.</p>\n<p><strong>Highyeild:</strong></p><p>Q fever is a disease caused by the bacteria Coxiella burnetii. This bacteria naturally infects some animals, such as goats, sheep, and cattle. burnetii bacteria are found in the birth products (i.e. placenta, amniotic fluid), urine, feces, and milk of infected animals. People can get infected by breathing in dust that has been contaminated by infected animal faeces, urine, milk, and birth products.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A & B are incorrect as - R. prowazekii and O. Tsutsugamushi are transmitted by louse and mite respectively both are arthropod vectors.</p>\n<p><strong>Extraedge:</strong></p><p>Coxiella burnetii is an obligate intracellular bacterial pathogen, and is the causative agent of Q fever.[1] The genus Coxiella is morphologically similar to Rickettsia, but with a variety of genetic and physiological differences. C. burnetii is a small Gram-negative, coccobacillary bacterium that is highly resistant to environmental stresses such as high temperature, osmotic pressure, and ultraviolet light. These characteristics are attributed to a small cell variant form of the organism that is part of a biphasic developmental cycle, including a more metabolically and replicatively active large cell variant form.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Borrelia recurrentis is transmitted by?", "options": [{"label": "A", "text": "Mite", "correct": false}, {"label": "B", "text": "Louse", "correct": true}, {"label": "C", "text": "Tick", "correct": false}, {"label": "D", "text": "Mosquito", "correct": false}], "correct_answer": "B. Louse", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Louse Transmission occurs when the louse is crushed and the infected haemocoel is released onto the human skin. Borrelia recurrentis is able to penetrate intact mucosa and skin. The transmission invokes the death of the louse, hence an individual louse can only infect one person.</p>\n<p><strong>Highyeild:</strong></p><p>Borrelia recurrentis is transmitted from person to person by ticks or lice. Epidemic relapsing fever is caused by louse-borne Borrelia recurrentis LBRF is caused by a spiral-shaped bacteria, Borrelia recurrentis, which is transmitted from human to human by the body louse.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Self-explanatory as all other options are not vectors of borrelia recurrentis.</p>\n<p><strong>Extraedge:</strong></p><p>Borrelia recurrentis is transmitted person to person by ticks or lice and is responsible for recurrent or relapsing fever. There are minor clinical differences between the louse-borne and tick-borne types. The onset is sudden, with high fever, headache, photophobia, myalgia, and arthralgia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not used to diagnose Leptospirosis?", "options": [{"label": "A", "text": "Darkfield microscopy", "correct": false}, {"label": "B", "text": "Microscopic agglutination test", "correct": false}, {"label": "C", "text": "Macroscopic agglutination test", "correct": false}, {"label": "D", "text": "Weil-Felix reaction", "correct": true}], "correct_answer": "D. Weil-Felix reaction", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Weil-Felix reaction Weil-felix reaction is NOT used to diagnose rickettsial fevers. Other options- A, B and C are used for the diagnosis of leptospirosis.</p>\n<p><strong>Highyeild:</strong></p><p>The most common way to diagnose leptospirosis is through serological tests either the Microscopic Agglutination Test (MAT) which detects serovar-specific antibodies, or a solid-phase assay for the detection of Immunoglobulin M (IgM) antibodies. Weil's Felix test revealed agglutination with OX-K antigen with a titre-1:160. Residual OX19 agglutinins, due to a previous attack of louse-borne typhus, do not show a significant fluctuation of the titre in the course of various febrile diseases.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. is incorrect as Leptospirosis are actively motile, which is best seen using a dark field microscope Option B. is incorrect - Specimens consist of aseptically collected blood in a heparin tube, CSF, or tissues for microscopic examination and culture. Urine should be collected using great care to avoid contamination. The serum is collected for agglutination tests. Option C. is incorrect - Agglutinating antibodies first appear 5–7 days after infection and develop slowly, reaching a peak at 5–8 weeks. Very high titers may be attained (>1:10,000). The reference laboratory standard for the detection of leptospiral antibodies uses microscopic agglutination of live organisms, which can be hazardous. The test is highly sensitive, but it is difficult to standardize</p>\n<p><strong>Extraedge:</strong></p><p>Weil Felix test Rickettsial infection (typhus fever) will cause heterophilic antibodies that agglutinate some strains of Proteus. The agglutination reactions, the basis of the test is the sharing of an Alkali stable carbohydrate antigen of rickettsia and by certain strains of Proteus. Slide and tube method. The test is negative for rickettsial pox False positive reactions may occur in urinary or other Proteus infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A sewer worker presented with fever, jaundice and conjunctival haemorrhage. Clinical diagnosis is most likely.", "options": [{"label": "A", "text": "Leptospirosis", "correct": true}, {"label": "B", "text": "Brucellosis", "correct": false}, {"label": "C", "text": "Aspergillosis", "correct": false}, {"label": "D", "text": "Plague", "correct": false}], "correct_answer": "A. Leptospirosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Leptospirosis Leptospirosis infection commonly passes unnoticed, as shown by high seroprevalence rates in endemic areas. However, severe disease may rarely occur as exemplified in the case presented here.</p>\n<p><strong>Highyeild:</strong></p><p>Complications including pulmonary haemorrhage, jaundice, renal impairment, myocarditis, and uveitis are all possibilities. Leptospirosis can lead to kidney damage, meningitis (inflammation of the membrane around the brain and spinal cord), liver failure, respiratory distress, and even death.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. is correct as conjunctival Haemorrhage is not a clinical feature of Brucellosis infection Brucellosis Infection - The incubation period ranges from 1–4 weeks. The onset is insidious, with malaise, fever, weakness, aches, and sweats. The fever usually rises in the afternoon; its fall during the night is accompanied by drenching sweat. There may be gastrointestinal and nervous symptoms. Lymph nodes enlarge, and the spleen becomes palpable. Hepatitis may be accompanied by jaundice. Deep pain and disturbances of motion, particularly in vertebral bodies, suggest osteomyelitis. These symptoms of generalized Brucella infection generally subside in weeks or months, although localized lesions and symptoms may continue. Option C. is incorrect as conjunctival haemorrhage is not a clinical feature of Aspergillosis. Aspergillosis can be of 3 types clinically – Allergic form, Aspergilloma and extrapulmonary Colonization and Invasive aspergillosis. Option D. is incorrect as plague doesn’t cause conjunctival haemorrhage and also lymphadenopathy with greatly enlarged an d tender nodes (buboes) in the neck, groin or axillae is an important clinical feature.</p>\n<p><strong>Extraedge:</strong></p><p>Humans can get leptospirosis through direct contact with urine from infected animals or through water, soil or food contaminated with their urine. It's most common in warm climates. High fever, headache, bleeding, muscle pain, chills, red eyes and vomiting are some symptoms. Without treatment, leptospirosis can lead to kidney and liver damage and even death.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Regarding Leptospirosis, which of the following is true?", "options": [{"label": "A", "text": "Rats are the reservoir", "correct": true}, {"label": "B", "text": "Person-to-person transmission", "correct": false}, {"label": "C", "text": "Orofecal transmission", "correct": false}, {"label": "D", "text": "Fluoroquinolones are the drug of choice", "correct": false}], "correct_answer": "A. Rats are the reservoir", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rats are the reservoir The role of rodents in the transmission of many diseases, including leptospirosis , is widely known. Rats abundant in urban and Peri domestic environments are the most important reservoirs and sources of Leptospira infection in humans and animals. Weil's disCARDIOVASCULARof a bacterial infection also known as Leptospirosis that is carried by animals, most commonly in rats and cattle. It can be caught by humans through contact with rat or cattle urine, most commonly occurring through contaminated fresh water(option C).</p>\n<p><strong>Highyeild:</strong></p><p>Leptospirosis is a worldwide zoonosis with a broad spectrum of animal hosts. The primary reservoir hosts are wild animals such as rodents, which can shed Leptospires throughout their lifetimes. Leptospira transmission: Indirect contact with water, moist soil and wet surfaces contaminated with animal urine Direct contact with urine and products of parturition, the placenta of infected animals Direct human-to-human transmission does not occur.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B is incorrect The leptospiroses are essentially animal infections; human infection is only accidental, occurring afte r contact with water or other materials contaminated with the excreta of animal hosts. Option C is incorrect Orofecal transmission is not seen in humans Option D is incorrect The drug of choice is Doxycycline which belongs to the tetracycline group of drugs.</p>\n<p><strong>Extraedge:</strong></p><p>Leptospirosis is a blood infection caused by the bacteria Leptospira[8] that can infect humans, dogs, rodents and many other wild and domesticated animals.[8] Signs and symptoms can range from none to mild (headaches, muscle pains, and fevers) to severe (bleeding in the lungs or meningitis).[5] Weil's disease, the acute, severe form of leptospirosis, causes the infected individual to become jaundiced (skin and eyes become yellow), develop kidney failure, and bleed.[6] Bleeding from the lungs associated with leptospirosis is known as severe pulmonary haemorrhage syndrome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the bacterium shown in the Image:", "options": [{"label": "A", "text": "Vibrio", "correct": false}, {"label": "B", "text": "Leptospira", "correct": true}, {"label": "C", "text": "Helicobacter", "correct": false}, {"label": "D", "text": "Campylobacter", "correct": false}], "correct_answer": "B. Leptospira", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504500780-QTDV007023IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Leptospira Large numbers of closely bound spirals and characteristic hooked ends are a feature of leptospira. Leptospira have a Gram-negative -like cell envelope membrane consisting of a cytoplasmic and 330 uter membrane. However, the peptidoglycan layer is associated with the cytoplasmic rather than the outer membrane, an arrangement that is unique to spirochetes. Leptospires have a typical double membrane structure in which the cytoplasmic membrane and peptidoglycan cell wall are closely associated. Leptospires have a typical double membrane structure in common with other spirochetes, in which the cytoplasmic membrane and peptidoglycan cell wall are present. Leptospires have a typical double membrane structure.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A is incorrect – Vibrio is a comma-shaped, c urved rod 2-4mm long. It is actively motile by means of a polar flagellum, since there is no flagellum in the picture above we can say that this is not vibrio Option C is incorrect – Helicobacter has multiple flagella at one pole and is actively motile. Option D is incorrect - campylobacters are gram-negative rods with a comma, S, or “ gull - wing ” shapes. They are motile, with a single polar flagellum, and do not form spores.</p>\n<p><strong>Extraedge:</strong></p><p>The symptoms of leptospirosis usually appear one to two weeks after infection,[7] but the incubation period can be as long as a month.[20] The illness is biphasic in a majority of symptomatic cases. Symptoms of the first phase (acute or leptospiremic phase) last five to seven days. In the second phase (immune phase), the symptoms resolve as antibodies against the bacteria are produced.[8] Additional symptoms develop in the second phase.[21] The phases of illness may not be distinct, especially in patients with severe illness.[22] 90% of those infected experience mild symptoms while 10% experience severe leptospirosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following species of Borrelia are associated with Tick-borne relapsing fever, except;", "options": [{"label": "A", "text": "Borrelia recurrentis", "correct": true}, {"label": "B", "text": "B. turicata", "correct": false}, {"label": "C", "text": "B. Hermsii", "correct": false}, {"label": "D", "text": "B. duttonii", "correct": false}], "correct_answer": "A. Borrelia recurrentis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Borrelia recurrentis is associated with louse-borne relapsing fever. Other options- B, C & D are associated with tick-borne relapsing fever. Borrelia is a genus of bacteria of the spirochete phylum. It causes Lyme disease, also called Lyme borreliosis, a zoonotic, vector-borne disease transmitted primarily by ticks and by lice, depending on the species of bacteria.</p>\n<p><strong>Highyeild:</strong></p><p>Relapsing Fever is an arthropod-borne infection caused by the spiral-shaped bacteria of the genus Borrelia, and sub-species Relapsing Fever Borrelia (RFB). These Borrelia are closely related to Borrelia burgdorferi, the causative agent of Lyme disease and are transmitted by ticks and lice.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C all are associated with tick-borne relapsing fever.</p>\n<p><strong>Extraedge:</strong></p><p>Borrelia recurrentis is transmitted from human to human by the body louse Pediculus humanus humanus. Head lice, Pediculus humanus capitis, have been found to be infected, but their role as vector has not been established. When feeding on an infected human, the body louse will ingest Borrelia recurrentis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following microorganisms shows antigenic variations as a major means of evading host defences;", "options": [{"label": "A", "text": "Streptococcus pneumonia", "correct": false}, {"label": "B", "text": "Borrelia recurrentis", "correct": true}, {"label": "C", "text": "Mycobacterium tuberculosis", "correct": false}, {"label": "D", "text": "Listeria monocytogenes", "correct": false}], "correct_answer": "B. Borrelia recurrentis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Borrelia recurrentis Antigenic variations occur as a major means of evading host defences because of DNA rearrangements in linear plasmids present in Borrelia.</p>\n<p><strong>Highyeild:</strong></p><p>Borrelia recurrentis is a species of Borrelia, a spirochaete bacterium associated with relapsing fever. B. recurrentis is usually transmitted from person to person by the human body louse. The body louse has been known as its only known vector. Antigenic variation: A common mechanism of immune evasion in pathogenic bacteria and protozoa is antigenic variation, in which genetic or epigenetic changes result in rapid, sequential shifts in a surface-exposed antigen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C & D do not exhibit antigenic variations hence incorrect.</p>\n<p><strong>Extraedge:</strong></p><p>Relapsing Fever is an arthropod-borne infection caused by the spiral-shaped bacteria of the genus Borrelia and sub-species Relapsing Fever Borrelia (RFB). These Borrelia are closely related to Borrelia burgdorferi, the causative agent of Lyme disease, and are transmitted by ticks and lice.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Tick is the vector for all of the following except:", "options": [{"label": "A", "text": "Rocky mountain spotted fever", "correct": false}, {"label": "B", "text": "Indian tick typhus", "correct": false}, {"label": "C", "text": "Boutonneuse fever", "correct": false}, {"label": "D", "text": "Rickettsial pox", "correct": true}], "correct_answer": "D. Rickettsial pox", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rickettsial pox Rickettsial pox is transmitted by mite. It is the exception amongst the spotted fever group which is not transmitted by ticks. It is mild and often self-limited.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & D: Rocky Mountain spotted fever, Indian tick typhus and Boutonneuse fever are all important examples of tick-borne spotted fever.</p>\n<p><strong>Extraedge:</strong></p><p>Epidemic typhus, also called louse-borne typhus, is an uncommon disease caused by a bacteria called Rickettsia prowazekii. Epidemic typhus is spread to people through contact with infected body lice.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Zoonotic tetrad is seen in:", "options": [{"label": "A", "text": "Q fever", "correct": false}, {"label": "B", "text": "Endemic typhus", "correct": false}, {"label": "C", "text": "Scrub typhus", "correct": true}, {"label": "D", "text": "Epidemic typhus", "correct": false}], "correct_answer": "C. Scrub typhus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Scrub typhus Zoonotic tetrad is a feature of Scrub typhus. Scrub typhus is caused by Orientia tsutsugamushi. Orientia tsutsugamushi has 3 major antigenic types: Karp, Kato and Gillam. It is transmitted by the Chiggers of trombiculid mites. Reservoir-rodents and birds. Four factors are essential for the establishment of a microfocus of infection: coexistence and intimate relationship of O.tsutsugamushi, chiggers, rats and a secondary or transitional form of vegetation called a zoonotic tetrad.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option a, b & d: Zoonotic tetrad is not seen in Q fever, endemic/epidemic typhus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All true about Q fever except:", "options": [{"label": "A", "text": "It is a zoonosis", "correct": false}, {"label": "B", "text": "Human disease is characterized by interstitial pneumonia", "correct": false}, {"label": "C", "text": "No rash", "correct": false}, {"label": "D", "text": "Weil-Felix reaction useful for diagnosis", "correct": true}], "correct_answer": "D. Weil-Felix reaction useful for diagnosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Weil-Felix reaction useful for diagnosis Coxiella burnetii The obligate intracellular pathogen, is filterable through bacterial filters. Resistant to heat and drying; survives the Holder method of pasteurization. Shows phase variation. Causes Q fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Two cycles of infection: wild animals and ticks; domestic animals (ticks not required) maintained by airborne transmission. Options B & C. Human infection: infected milk, handling infected wool, hide, inhalation of soil contaminated with faeces of infected animals, tick do not play a significant role. No rash. Fever, chills. Often resolve spontaneously. Pneumonia, hepatitis. Endocarditis in chronic Q fever.</p>\n<p><strong>Extraedge:</strong></p><p>Serology & Immunology Weil Felix test Rickettsial infection (typhus fever) will cause heterophilic antibodies that agglutinate some strains of Proteus. The agglutination reactions, the basis of the test is the sharing of an Alkali stable carbohydrate antigen of rickettsia and by certain strains of Proteus. Slide and tube method. The test is negative for rickettsialpox, False positive reactions may occur in urinary or other Proteus infections.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Bartonella henselae causes all except;", "options": [{"label": "A", "text": "Oroya fever", "correct": true}, {"label": "B", "text": "Cat scratch disease", "correct": false}, {"label": "C", "text": "Bacillary angiomatosis", "correct": false}, {"label": "D", "text": "SABE Subacute bacterial endocarditis", "correct": false}], "correct_answer": "A. Oroya fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Oroya fever Oroya fever is caused by Bartonella bacilliformis . It is also called Carrion's disease . The vector is sandfly.</p>\n<p><strong>Highyeild:</strong></p><p>The most common findings are fever (usually sustained but with a temperature no greater than 102 °F (39 °C)), pallor, malaise, nonpainful hepatomegaly, jaundice, lymphadenopathy, splenomegaly. This phase is characterized by severe hemolytic anaemia and transient immunosuppression. The drug of choice is Chloramphenicol in adults and Chloramphenicol plus beta-lactams in children.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: B henselae causes cat scratch disease. Option C: B henselae causes Bacillary angiomatosis or bacillary peliosis in immunocompromised patients. Option D: B henselae can also cause bacteremia or endocarditis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Well Weifelix reaction for Scrub typhus shows positivity for:", "options": [{"label": "A", "text": "OXK", "correct": true}, {"label": "B", "text": "OXK & OXI9", "correct": false}, {"label": "C", "text": "OX-2", "correct": false}, {"label": "D", "text": "OX-19", "correct": false}], "correct_answer": "A. OXK", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>OXK In Scrub typhus, Well Felix’s reaction shows a raise in OXK titre . Rickettsial antibodies were detected against Proteus OX 19, OX2 and OX K antigens in the Weil Felix test. In scrub typhus- OXK antibody positive</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: In epidemic and endemic typhus- OX 19 antibody positive mainly, +/- OX2 Options C & D: In tickborne spotted fever- OX 19 and OX 2 antibodies positive</p>\n<p><strong>Extraedge:</strong></p><p>Weil-Felix Reaction - A Heterophile Agglutination Test A Weil-Felix reaction is a type of agglutination test in which patients serum is tested for agglutinins to O antigen of certain non-motile Proteus and rickettsial strains (OX19, OX2, OXK) OX19, OX2 are strains of Proteus vulgaris. OXK is the strain of Proteus mirabilis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 34 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Germ theory was given by:", "options": [{"label": "A", "text": "Louis Pasteur", "correct": true}, {"label": "B", "text": "Antony von Leuwenhock", "correct": false}, {"label": "C", "text": "Robert Koch", "correct": false}, {"label": "D", "text": "Joseph Lister", "correct": false}], "correct_answer": "A. Louis Pasteur", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Louis Pasteur The essential contributions of this French scientist were: He disapproved of the theory of spontaneous generation and proposed the germ theory of disease. We have developed methods of sterilization and disinfection (hot air oven, autoclave). She developed attenuated vaccines for anthrax, rabies, and chicken cholera. It established the growth requirements of bacteria. Louis Pasteur-Father of modern microbiology, introduced the term microbiology.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. First observed bacteria and other microorganisms using a single-lens microscope he constructed and named tiny organisms as ‘Animalcules.’ Option C. Robert Koch Discovered: Anthrax, Tubercle & cholera bacillus. Methods to obtain bacteria in pure culture. Solid media. Staining techniques. Koch postulates and Koch’s phenomenon. Option D. Father of antiseptic surgery-Joseph Lister. Father of chemotherapy-Paul Ehrlich.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Principles of asepsis in surgery were introduced by:", "options": [{"label": "A", "text": "Louis Pasteur", "correct": false}, {"label": "B", "text": "Anatony van Leuwenhoek", "correct": false}, {"label": "C", "text": "Robert Koch", "correct": false}, {"label": "D", "text": "Joseph Lister", "correct": true}], "correct_answer": "D. Joseph Lister", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Joseph Lister J oseph Lister applied Pasteur’s work & introduced antiseptic techniques in surgery. He is known as the father of antiseptic surgery.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. The essential contributions of this French scientist were: He disapproved of the theory of spontaneous generation and proposed the germ theory of disease. He developed methods of sterilization and disinfection (hot air oven, autoclave). He developed attenuated vaccines for anthrax, rabies, and chicken cholera. He has established the growth requirements of bacteria. Louis Pasteur-Father of modern microbiology, introduced the term microbiology. Option B. First observed bacteria and other microorganisms using a single lens microscope he constructed and named tiny organisms as ‘Animalcules.’ Option C. Robert Koch Discovered: Anthrax, Tubercle & cholera bacillus Methods to obtain bacteria in pure culture Solid media Staining techniques Koch postulates and Koch’s phenomenon</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Koch discovered the causative organism for tuberculosis and:", "options": [{"label": "A", "text": "Rabies", "correct": false}, {"label": "B", "text": "Leprosy", "correct": false}, {"label": "C", "text": "Influenza", "correct": false}, {"label": "D", "text": "Cholera", "correct": true}], "correct_answer": "D. Cholera", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cholera Koch discovered the causative organism for tuberculosis and Cholera.</p>\n<p><strong>Highyeild:</strong></p><p>Contributions of Robert Koch. Concept of smear making and staining with aniline dyes. The idea of cultivation of bacteria on solid media and hanging drop methods. Discovered: Anthrax, Tubercle & cholera bacillus. The Koch postulates prove the role of an organism in the causation of a disease. Nobel Prize for his work on TB in 1905</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Georg Gottfried Zinke first transmitted rabies from a rabid dog to a healthy one. Louis Pasteur discovered the vaccine for rabies. Option: B. Causative organism for leprosy was discovered by Gerhard-Henrik Armauer Hansen – A Norwegian scientist. Option: C. Richard Shope discovered the Influenza virus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "2nd-year microbiology lectures are in progress. All of the following contributions are credited to Louis Pasteur, except:", "options": [{"label": "A", "text": "Introduced techniques of sterilization and developed the steam sterilizer, hot-air oven, and autoclave", "correct": false}, {"label": "B", "text": "Established the differing growth needs of different bacteria", "correct": false}, {"label": "C", "text": "Contributed to the knowledge of anthrax, chicken cholera, and hydrophobia", "correct": false}, {"label": "D", "text": "Introduced antiseptic techniques in surgery", "correct": true}], "correct_answer": "D. Introduced antiseptic techniques in surgery", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Introduced antiseptic techniques in surgery The development of microbiology as a scientific discipline by Louis Pasteur introduced sterilization techniques and developed the steam sterilizer, hot-air oven, and autoclave. An immediate application of Pasteur's work was the introduction of antiseptic techniques in surgery by Joseph Lister, effecting a pronounced drop in mortality and morbidity due to surgical sepsis. Lister's antiseptic surgery involving carbolic acid was a milestone in the evolution of surgical practice from the era of 'laudable pus' to modern aseptic techniques.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. He also established the growth needs of different bacteria Option: B. And contributed to the knowledge of anthrax, chicken cholera, and hydrophobia. Option: C. An accidental observation that chicken-cholera bacillus cultures left on the bench for several weeks lost their pathogenic property but retained their ability to protect the birds against subsequent infection by them led to the discovery of the process of attenuation and the development of live vaccines attenuated cultures of the anthrax bacillus by incubation at high temperature- (42-43°C) and proved that injection of such cultures in animals induced specific protection against anthrax. It was Pasteur who coined the term vaccine for such prophylactic preparations.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Given below are images of prominent scientists in the field of microbiology. Correctly match the columns:", "options": [{"label": "A", "text": "1-R 2-P 3-Q 4-S", "correct": true}, {"label": "B", "text": "1-S 2-R 3-P 4-Q", "correct": false}, {"label": "C", "text": "1-Q 2-S 3-R 4-P", "correct": false}, {"label": "D", "text": "1-P 2-Q 3-S 4-R", "correct": false}], "correct_answer": "A. 1-R 2-P 3-Q 4-S", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689236498663-QTDV036005IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1-R 2-P 3-Q 4-S</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Given below are all achievements of Robert Koch, except:", "options": [{"label": "A", "text": "He introduced staining techniques.", "correct": false}, {"label": "B", "text": "He introduced methods of obtaining bacteria in pure culture using solid media.", "correct": false}, {"label": "C", "text": "He discovered the bacillus of tuberculosis and the cholera vibrio.", "correct": false}, {"label": "D", "text": "He laid the foundations of biological standardization.", "correct": true}], "correct_answer": "D. He laid the foundations of biological standardization.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>He laid the foundations of biological standardization. Paul Ehrlich, who studied toxins and antitoxins quantitatively, laid the foundations of biological standardization.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & B. Robert Koch in Germany perfected bacteriological techniques during his studies on the culture and life cycle of the anthrax bacillus. He introduced staining techniques and methods for obtaining bacteria using solid media in pure culture. Option C. He discovered the bacillus of tuberculosis and the cholera vibrio. (OPTION C)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following options below are all correct conditions of Koch's postulates: The bacterium should be constantly associated with the lesions of the disease. Isolating the bacteria in pure culture from the lesions should be possible. Inoculation of such pure culture into suitable laboratory animals should reproduce lesions of the disease. Reisolating the bacterium in pure culture should be possible from the lesions produced in experimental animals. Select the correct answer from the given below code:", "options": [{"label": "A", "text": "1, 2", "correct": false}, {"label": "B", "text": "2, 3, 4", "correct": false}, {"label": "C", "text": "1, 4", "correct": false}, {"label": "D", "text": "1, 2, 3, 4", "correct": true}], "correct_answer": "D. 1, 2, 3, 4", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1, 2, 3, 4 All statements are correct. Different investigators in such profusion reported the causative agents of various infectious diseases. Hence, it became necessary to introduce criteria for proving the claims that a microorganism isolated from an illness was indeed causally related to it. These criteria were enunciated by Koch and are known as Koch's postulates. According to these, a microorganism can be accepted as the causative agent of an infectious disease only if the following conditions are satisfied: - The bacterium should be constantly associated with the lesions of the disease. (STATEMENT 1) Isolating the bacteria in pure culture from the lesions should be possible. (STATEMENT 2) Inoculation of such pure culture into suitable laboratory animals should reproduce lesions of the disease. (STATEMENT 3) Reisolating the bacteria in pure culture from the lesions produced in experimental animals should be possible. (STATEMENT 4) Self-explanatory, as all the options are correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The foundations of immunochemistry were laid by:", "options": [{"label": "A", "text": "Karl Landsteiner", "correct": true}, {"label": "B", "text": "Niels Jerne", "correct": false}, {"label": "C", "text": "Paul Ehrlich", "correct": false}, {"label": "D", "text": "Frank Burnet", "correct": false}], "correct_answer": "A. Karl Landsteiner", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Karl Landsteiner The study of immunity had to await advances in protein chemistry. The pioneering work of Karl Landsteiner laid the foundations of immunochemistry.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B & C. In 1955, Niels Jerne proposed the natural selection theory of antibody synthesis, which attempted to explain the chemical specificity and biological basis of antibody synthesis, signifying a return to the original views of antibody formation proposed by Paul Ehrlich (1898). Option: D. Frank Burnet (1957) modified this into the clonal selection theory, a concept which, with minor alterations, holds sway even now.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 18 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 52-year-old man is hospitalized due to 2 weeks of low-grade fever, malaise, anorexia, and fatigue. The patient has a history of bicuspid aortic valve and underwent aortic valve replacement a year ago. Physical examination reveals a new regurgitation murmur. Blood cultures repeatedly grow gram-positive cocci in clusters, which are identified as Staphylococcus epidermis. This pathogen most likely demonstrates which of the following characteristics?", "options": [{"label": "A", "text": "Alpha hemolysis", "correct": false}, {"label": "B", "text": "Mannitol fermentation", "correct": false}, {"label": "C", "text": "Novobiocin resistance", "correct": false}, {"label": "D", "text": "Negative coagulase test", "correct": true}], "correct_answer": "D. Negative coagulase test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Negative coagulase test Staphylococcus epidermidis is a low-virulence skin commensal that rarely causes infection in healthy patients. However, those with prosthetic devices (eg, indwelling catheters, artificial heart valves, artificial joints) are at risk because the pathogen produces adhesion and biofilm proteins that allow it to grow on artificial surfaces. S epidermidis is one of the most common contaminants of blood cultures, but infection should be suspected when multiple blood cultures grow the bacteria and/or the patient has symptoms of clinical infection such as fever, malaise, and leukocytosis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Alpha hemolysis (partial, green hemolysis when plated on blood agar) is a feature of viridans streptococci, a common cause of infective endocarditis. Staphylococci species are either beta-hemolytic (complete hemolysis) or gamma-hemolytic (no hemolysis). S epidermidis is gamma-hemolytic. Option B. S aureus and S hemolytic can ferment mannitol, but S epidermidis cannot. Option C. Novobiocin is an antibiotic that can differentiate S saprophyticus from other coagulase-negative Staphylococcus species: S saprophyticus is novobiocin-resistant whereas others, such as S epidermidis, are novobiocin-sensitive.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 68-year-old woman with end-stage renal disease receiving intermittent hemodialysis comes to the office due to back pain. She says that she may have \"pulled a muscle\" while getting out of her car a week ago; since then she has had progressively worsening back pain. She has no leg numbness or weakness but reports malaise and fatigue. The patient also has hypertension and type 2 diabetes mellitus and was treated several weeks ago for staphylococcal bacteremia associated with the dialysis catheter. Her temperature is 38 C (100.4 F). On examination, she has tenderness over the upper lumbar vertebrae without overlying skin changes. The straight leg raise test is negative. Which of the following is the best next step in the management of this patient?", "options": [{"label": "A", "text": "Analgesics and close follow-up", "correct": false}, {"label": "B", "text": "CT myelogram", "correct": false}, {"label": "C", "text": "Lumbar puncture", "correct": false}, {"label": "D", "text": "MRI of the spine", "correct": true}], "correct_answer": "D. MRI of the spine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>MRI of the spine Although this patient believes her back pain may be due to a muscle sprain, her presentation ( localized bony back pain, low-grade fever, recent staphylococcal bacteremia ) suggests vertebral osteomyelitis. This patient has comorbidities such as diabetes, and renal disease making her more prone to such infections. Bacteria can access the spine by hematogenous spread from a distant infection (eg, skin or soft tissue, intravenous catheter), direct invasion from trauma or local spinal procedures (eg, lumbar puncture, spinal surgery), or direct spread from adjacent soft tissue infection.</p>\n<p><strong>Highyeild:</strong></p><p>Bacterial Osteomyelitis Hematogenous spread is most common as the adult vertebral bone has a very rich and vascular marrow. Increasing age can cause the nutrient arteries to develop a \"corkscrew\" anatomy, which allows bacteria to more easily penetrate the marrow cavity and cause a local Bacteremia due to intravascular devices (eg, hemodialysis catheters) increases the risk of healthcare-related vertebral osteomyelitis. Offending organisms include Staphylococcus (most common is S aureus or coagulase-negative staphylococci) and various gram-negative organisms (eg, Pseudomonas). Vertebral osteomyelitis should be suspected in patients with new or worsening back pain, fever, and recent endocarditis or bacteremia (especially S aureus). It should also be suspected if there are new neurologic findings and fever, with or without back pain. Initial evaluation includes blood cultures and MRI of the spine , which is the most sensitive imaging method for diagnosing vertebral osteomyelitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Analgesics and close follow-up are recommended for musculoskeletal causes of low back pain, but this patient's clinical findings (fever, localized bony tenderness, recent bacteremia) are concerning for more serious etiologies and require further evaluation. Option B. CT myelogram, which can diagnose spinal stenosis or other vertebral pathology (including osteomyelitis), is performed by injecting contrast into the lumbar spine before CT imaging. However, it is more invasive than MRI and usually reserved for patients who cannot undergo MRI (eg, those with a pacemaker, or metallic implants). Option C. Lumbar puncture is typically used for diagnosing meningitis and has a low yield for diagnosing vertebral osteomyelitis. GT-guided bone biopsy is usually preferred for isolating the organism after imaging confirms the diagnosis of vertebral osteomyelitis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 37-year-old man is brought to the emergency department following a motor vehicle accident in which he was an unrestrained driver. Paramedics report that his breath smelled of alcohol at the scene. En route to the hospital, the patient receives 2 L intravenous normal saline. In the emergency department, his blood pressure is 100/60 mm Hg, pulse is 130/min, and respirations are 44/min. He is admitted directly to the intensive care unit, where he is intubated and placed on mechanical ventilation. A decision is made to insert a central venous catheter. In addition to sterile draping during the procedure, which of the following actions would be most likely to prevent intravascular catheter-related infections?", "options": [{"label": "A", "text": "Alcohol-based hand scrub prior to beginning the procedure", "correct": true}, {"label": "B", "text": "Daily application of topical mupirocin at the catheter site", "correct": false}, {"label": "C", "text": "Insertion of the catheter in the femoral vein", "correct": false}, {"label": "D", "text": "One dose of intravenous vancomycin before catheter insertion", "correct": false}], "correct_answer": "A. Alcohol-based hand scrub prior to beginning the procedure", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Alcohol-based hand scrub prior to beginning the procedure Central venous catheters (CVCs) are commonly used for hemodynamic monitoring and administration of fluids and medications in critically ill patients. Infection originating from the patient's skin flora or bacteria in the hands of healthcare workers is one of the major complications of CVCs. Hand hygiene is the most important step in the prevention of any hospital-associated infections. Gram-positive cocci, primarily coagulase-negative staphylococci, and Staphylococcus aureus, account for the majority of these infections.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Topical antimicrobial ointments do not reduce the rate of CVC-related infections and are associated with an increased risk of antimicrobial resistance and Candida colonization. Option C. Use of subclavian or internal jugular insertion sites (femoral vein has a higher risk of infection) Option D. Oral or parenteral antibiotics have not been found to reduce the incidence of CVC-related infections. In addition, the prophylactic use of vancomycin has been found to increase the risk of vancomycin-resistant enterococcus.</p>\n<p><strong>Extraedge:</strong></p><p>Care bundle for CLABSI(Central ine associated blood stream infection) The Centers for Disease Control and Prevention recommend the following steps to reduce CVC infections: Hand hygiene with an alcohol sanitizer or soap and water before donning sterile gloves Maximal barrier precautions during insertion (surgical mask, sterile gloves, long-sleeved surgical gown, and a large sterile sheet drape) Preparation of the insertion site with 2% chlorhexidine antiseptic Prompt removal of the catheter when it is no longer needed</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 57-year-old woman is hospitalized with high-grade fevers, chills, and right upper abdominal pain. Her temperature is 40 C (104 F). A physical examination of the abdomen shows rebound tenderness. Laboratory studies show elevated aspartate and alanine aminotransferases. Imaging studies reveal a fluid-filled cavity within the right lobe of the liver as shown below. Which of the following microorganism/route combinations is most likely to be the cause of this patient's infection?", "options": [{"label": "A", "text": "Chlamydia trachomatis due to ascending cholangitis", "correct": false}, {"label": "B", "text": "Cytomegalovirus by direct invasion from a nearby source", "correct": false}, {"label": "C", "text": "Entamoeba histolytica due to a penetrating stab wound", "correct": false}, {"label": "D", "text": "Staphylococcus aureus by the hematogenous route", "correct": true}], "correct_answer": "D. Staphylococcus aureus by the hematogenous route", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251447566-QTDV069004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Staphylococcus aureus by the hematogenous route The presence of a fluid-filled cavity in the liver in conjunction with fevers, chills, and right upper abdominal pain is suggestive of a hepatic abscess. In developing countries, hepatic abscesses have a relatively high incidence and are usually caused by parasitic infections (eg, Entamoeba histolytica) or more commonly bacterial hepatic abscesses caused in about 80% of cases by Staphylococcus spp, Esch. coli, Klebsiella spp. Enterococcus spp.</p>\n<p><strong>Highyeild:</strong></p><p>Hepatic abscess: Pyogenic bacteria can gain access to the liver through the following routes: Biliary tract infection (eg, ascending cholangitis) Portal vein pyemia (bowel or peritoneal sources) Hepatic artery (systemic hematogenous seeding) Direct invasion from an adjacent source (eg, peritonitis, cholecystitis) Penetrating trauma or injury The types of organisms causing a hepatic abscess depend on the route of hepatic access. Systemic hematogenous seeding of the liver secondary to Staphylococcus aureus infection at a distant site is the most commonly seen along with enterobacterial.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Ascending cholangitis is usually caused by enteric gram-negative bacilli (eg, Escherichia coli, Klebsiella) and enterococci. Chlamydia trachomatis is transmitted sexually and is not found in the enteric environment. Option B. Hepatic abscesses that arise by direct invasion from a nearby source are usually enteric gram-negative bacilli and enterococci. Cytomegalovirus can cause hepatitis in the immunosuppressed patient, but it is not associated with the development of a hepatic abscess. Option C. Traumatic penetrating injuries to the abdomen (eg, stab wound) typically result in abscesses that contain mixed aerobic and anaerobic flora. Entamoeba histolytica is most often transmitted through foodborne exposure and in areas with poor sanitation. It can cause a hepatic abscess by ascending from the colon through the portal venous system.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 10-year-old boy is brought to the emergency department after experiencing high fevers and chills for the last few days. He also complains of dull pain just above his left knee. He has no history of recent trauma other than minor scrapes to his knees and elbows while playing outside. Physical examination shows point tenderness 3 cm above the kneecap. There is no joint effusion. Radiographs show soft-tissue swelling and a periosteal reaction over the lower end of the femur. Which of the following organisms is most likely responsible for this patient's symptoms?", "options": [{"label": "A", "text": "Enterococcus faecalis", "correct": false}, {"label": "B", "text": "Moraxella catarrhalis", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": true}, {"label": "D", "text": "Staphylococcus epidermidis", "correct": false}], "correct_answer": "C. Staphylococcus aureus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Staphylococcus aureus Sudden onset of pain and blunt trauma– always think about staphylococcus aureus infection. Osteomyelitis is an infection of bone and bone marrow that occurs by 1 of 3 mechanisms: Hematogenous seeding due to an episode of bacteremia. Spread from a contiguous focus of infection, as occurs in an infected diabetic foot wound. Direct inoculation of bone, such as with a compound fracture.</p>\n<p><strong>Highyeild:</strong></p><p>Hematogenous osteomyelitis occurs predominantly in children (particularly boys) and most frequently affects the long bones. The tibia, fibula, and femur are most often involved. Adults who develop the condition are more likely to have vertebral involvement and frequently have a predisposition to bacteremia due to risk factors such as IV drug abuse or indwelling vascular catheters. The presenting symptoms of hematogenous osteomyelitis are vague, and a high index of suspicion is required to make the diagnosis. Initial symptoms such as malaise and fevers are non-specific. As the infection progresses, infants and younger children may refuse to move the affected extremity. Older children often complain of pain over a long bone. Bone pain develops as the abscess expands within the bone, leading to bone necrosis, periosteal disruption, and swelling of the surrounding soft tissue. Staphylococcus aureus is implicated in most cases of acute hematogenous osteomyelitis in otherwise healthy children. Causes of osteomyelitis Associated condition Mode of infection Most frequent pathogen Typical location Childhood age Hematogenous seeding during an episode of bacteremia Staphylococcus aureus Long bones Sickle cell disease Hematogenous seeding to infarcted bone Salmonella Staphylococcus aureus Long bones Pott disease Hematogenous seeding from lungs Mycobacterium tuberculosis Vertebrae Diabetes mellitus Contiguous spread from infected foot ulcer Polymicrobial Bones of the feet Recumbent patients with impaired mobility Contiguous spread from pressure sores Polymicrobial Sacrum & heels Recent trauma or orthopedic surgery Direct inoculation Polymicrobial Variable</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Enterococcus faecalis causes a variety of infections, including endocarditis, meningitis, and urinary tract infections. Enterococcus can cause vertebral osteomyelitis after a recent urinary tract infection via bacteremic spread. Option B. Moraxella catarrhalis is a part of the normal flora of the upper respiratory tract. It causes otitis media and sinusitis in healthy individuals and is frequently responsible for causing exacerbation of chronic obstructive pulmonary disease. Option D. Staphylococcus epidermidis is ubiquitous and is commonly isolated in cultures as a contaminant. However, S epidermidis can also be pathogenic, colonizing intravenous catheters and other foreign bodies such as prosthetic heart valves and orthopedic hardware, leading to bacteremia and sepsis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old man with multiple injuries sustained in a motorcycle accident develops osteomyelitis while in the hospital. The organism is identified as methicillin-sensitive Staphylococcus aureus, and antibiotics are started. Which of the following is the most important measure to reduce the risk of transmission to other patients?", "options": [{"label": "A", "text": "Contact precautions", "correct": false}, {"label": "B", "text": "Hand hygiene", "correct": true}, {"label": "C", "text": "Isolation precautions", "correct": false}, {"label": "D", "text": "Masks", "correct": false}], "correct_answer": "B. Hand hygiene", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hand hygiene Hand hygiene by health care workers is the single most important measure to reduce the risk of transmission of microorganisms between patients. It includes handwashing with soap and water or using alcohol-based hand sanitizers t hat do not require water. Proper handwashing technique involves washing all surfaces of the hands and fingers with soap and water for at least 30 seconds, drying with a disposable towel, and using the towel to turn off the faucet. Alcohol-based hand sanitizer should cover all surfaces of the hands and fingers and be allowed to dry.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Important aspect but can’t replace hand hygiene- Contact precautions involve wearing nonsterile gloves for all patient contact and gowns during substantial contact with infective material. These precautions are indicated when caring for patients with specific multidrug-resistant bacteria (eg, methicillin-resistant Staphylococcus aureus, vancomycin-resistant enterococci) or with certain parasitic or viral pathogens. This patient's methicillin-sensitive Staphylococcus aureus infection does not require the use of contact precautions. Option C. Isolation precautions are indicated in the care of patients with infectious airborne diseases (eg, tuberculosis) and involve a private airborne infection isolation room with negative air pressure, closed doors, and the use of specialized particulate respirator masks. Option D. Facemasks are used as a barrier for respiratory secretions and are not a substitute for hand-washing.</p>\n<p><strong>Extraedge:</strong></p><p>WHO- 5 Moment of hand hygiene</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old boy is brought to the office due to skin lesions on his chin for the past 2 days. The temperature is 36.1 C (97 F). The patient is well appearing. There are mildly tender peri-oral papules and pustules, some of which appear to have broken down and are covered with amber-colored crusting. A wound culture is taken, and Gram stain shows gram-positive cocci in chains. Which of the following symptoms would be most likely to develop as a potential complication of this patient's infection?", "options": [{"label": "A", "text": "Ascending weakness", "correct": false}, {"label": "B", "text": "Facial puffiness and dark urine", "correct": true}, {"label": "C", "text": "Fatigue and heart murmur", "correct": false}, {"label": "D", "text": "Joint pain and eye redness", "correct": false}], "correct_answer": "B. Facial puffiness and dark urine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Facial puffiness and dark urine This child has impetigo, a superficial bacterial infection that most commonly develops on the face or extremities in children. The most common pathogen is Staphylococcus aureus followed by group A Streptococcus (GAS, S pyogenes) . Of all the options available, GAS sequelae are the most appropriate answer.</p>\n<p><strong>Highyeild:</strong></p><p>Impetigo Patients usually develop mildly itchy or painful erythematous papules and pustules that later erupt, forming honey-colored crusting . Treatment of localized impetigo is with antibiotics, and most patients have no long-term sequelae. However, a minority of patients may develop post-streptococcal glomerulonephritis (PSGN) several weeks after impetigo caused by GAS (as indicated by this patient's Gram stain showing gram-positive cocci in chains). Renal damage is caused by immune complex deposition as well as complement activation , leading to a massive inflammatory response that damages the glomerular basement membrane . Symptoms of PSGN range from asymptomatic, microscopic hematuria to gross hematuria and nephrotic-range proteinuria. In addition to tea- or cola-colored urine, patients may develop periorbital/facial swelling, generalized edema, and hypertension. Laboratory evaluation typically reveals elevated creatinine and decreased complement C3 level and anti-DNAase B levels</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Ascending weakness is a classic feature of Guillain-Barre syndrome, which may be preceded by an upper respiratory or gastrointestinal (eg, Campylobacter jejuni) infection. The GAS disease is not associated with this condition. Option C. Fatigue and a new heart murmur due to carditis can be manifestations of acute rheumatic fever, potential post-streptococcal sequelae associated with GAS pharyngitis. This disease is not associated with impetigo in developed regions, although this relationship is less clear in some parts of the developing world. Option D. Eye redness (due to conjunctivitis or anterior uveitis) and joint pain may be seen in reactive arthritis, which typically occurs following a diarrheal (eg, Salmonella) or genitourinary (eg, chlamydial) infection, not impetigo.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 15-year-old boy comes into the clinic with pain in his right ear. He is on his school swim team and spends about 2 hours per day in the pool. Along with the pain in his ear, he has watery drainage coming from the ear canal. On examination his vital signs are normal, and he appears healthy, but his left external ear looks quite red and there is copious watery, slightly green drainage coming from the ear. The organism mostly likely causing this is:", "options": [{"label": "A", "text": "Staph aureus", "correct": false}, {"label": "B", "text": "Viridans group streptococci", "correct": false}, {"label": "C", "text": "Streptococcus pneumoniae", "correct": false}, {"label": "D", "text": "Pseudomonas aeruginosa", "correct": true}], "correct_answer": "D. Pseudomonas aeruginosa", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pseudomonas aeruginosa An external ear canal infection may sometimes be caused by pseudomonas and result in a “swimmer's ear.” Symptoms may include swelling. ear pain. itching inside the ear. Pseudomonas aeruginosa causes many different infections. Swimmer's ear (external otitis) is a mild external infection that can occur in otherwise healthy people.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It is the leading cause of skin and soft tissue infections such as abscesses (boils), furuncles, and cellulitis. Although most staph infections are not serious, S. aureus can cause serious infections such as bloodstream infections, pneumonia, or bone and joint infections. Option B. The viridans streptococci are a large group of commensal streptococcal Gram-positive bacteria species that are α-hemolytic, producing a green coloration on blood agar plates, although some species in this group are γ-hemolytic, meaning they produce no change on blood agar. Option C. Streptococcus pneumoniae are lancet-shaped, gram-positive, facultatively anaerobic bacteria with more than 100 known serotypes. Most S. pneumoniae serotypes can cause disease, but only a minority of serotypes produce the majority of pneumococcal infections. So, Options A, B, and C. Are not the correct option.</p>\n<p><strong>Extraedge:</strong></p><p>Malignant otitis externa: Also caused by Pseudomonas spp. Malignant otitis externa is a life-threatening infection that mainly affects the external auditory canal and skull base, and the infection can also invade the stylomastoid and jugular foramina. Treatment for malignant external otitis (MEO) includes meticulous glucose control, aural toilet, systemic and orthotopic antimicrobial therapy, and hyperbaric oxygen therapy. Surgery is now reserved for local debridement, removal of bony sequestrum, and abscess drainage</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following tests can be used for differentiating in GPC :", "options": [{"label": "A", "text": "Gram staining", "correct": false}, {"label": "B", "text": "Hemolysis on blood agar", "correct": false}, {"label": "C", "text": "Catalase test", "correct": true}, {"label": "D", "text": "Coagulase test", "correct": false}], "correct_answer": "C. Catalase test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Catalase test Catalase test differentiates Staphylococcus (positive) Streptococcus (negative) The enzyme, catalase, is produced by bacteria that respire using oxygen and protects them from the toxic by-products of oxygen metabolism. The catalase test tests for the presence of catalase, an enzyme that breaks down the harmful substance hydrogen peroxide into water and oxygen. If an organism can produce catalase, it will produce bubbles of oxygen when hydrogen peroxide is added to it. Bubbles are a positive result for the presence of catalase.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Gram staining is positive in all GPC. Option B. Hemolysis on blood agar in GPC is generally the same - showing positive hemolysis. It is an important diagnosing point but not a differentiating point. Option D. Coagulase test - Gram-positive cocci include Staphylococcus (catalase-positive), which grows clusters. The staphylococci further subdivide into coagulase-positive (S. aureus) and coagulase-negative (S. epidermidis).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True statements about Staphylococcus include all except:", "options": [{"label": "A", "text": "They belong to the bacterial family Micrococcaceae", "correct": false}, {"label": "B", "text": "Only coagulase-positive species cause human diseases", "correct": true}, {"label": "C", "text": "They are oxidase negative", "correct": false}, {"label": "D", "text": "They are all catalase positive", "correct": false}], "correct_answer": "B. Only coagulase-positive species cause human diseases", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Only coagulase-positive species cause human diseases Coagulase-negative staphylococci (CoNS) are a type of staph bacteria that commonly live on a person's skin. Doctors typically consider CoNS bacteria harmless when it remains outside the body.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Staphylococci are members of the family Micrococcaceae, which also includes Micrococcus, Streptococcus, and Plano Coccus. Option D. These bacteria are catalase-positive, gram-positive cocci that divide into irregular clusters, producing a “grapelike cluster. Staphylococcus species are facultative anaerobic organisms capable of growth both aerobically and anaerobically. However, the bacteria can cause infections when present in large amounts, or when present in the bloodstream. Option C. Staphylococcus species are mostly oxidase negative except Staph lentus, Staph virulent, and Staph sciuri . So, Options A, C, and D . Are all true statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient in an ICU is on a CVP line. Blood culture grows gram-positive coccus which is Catalase positive and coagulase negative. Cause is:", "options": [{"label": "A", "text": "A. S. aureus", "correct": false}, {"label": "B", "text": "S. Epidermidis", "correct": true}, {"label": "C", "text": "S. pyogenes", "correct": false}, {"label": "D", "text": "E. Fecalis", "correct": false}], "correct_answer": "B. S. Epidermidis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>S. Epidermidis Staphylococcus epidermidis is a Gram-positive bacterium, which is catalase positive and coagulase-negative and one of over 40 species belonging to the genus Staphylococcus. It is part of the normal human flora, typically the skin flora, and less commonly the mucosal flora. It is a facultative anaerobic bacteria. Epidermidis can cause opportunistic infections, which include particularly biofilm-associated infections on indwelling medical devices. These often can disseminate into the bloodstream; and in fact, S. epidermidis is the most frequent cause of nosocomial sepsis. epidermidis is a very hardy microorganism, consisting of nonmotile, Gram-positive cocci, arranged in grape-like clusters. It forms white, raised, cohesive colonies about 1–2 mm in diameter after overnight incubation and is not hemolytic on blood agar.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Catalase positive and coagulase positive. Option C. Catalse negative Option D. E. faecalis is catalase negative</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An outbreak of sepsis caused by Staphylococcus aureus has occurred in the newborn nursery. You are called upon to investigate. According to your knowledge of the normal flora, what is the most likely source of the organism?", "options": [{"label": "A", "text": "Nose", "correct": true}, {"label": "B", "text": "Colon", "correct": false}, {"label": "C", "text": "Vagina", "correct": false}, {"label": "D", "text": "Throat", "correct": false}], "correct_answer": "A. Nose", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nose Staph bacteria commonly live inside the nose and are usually harmless. The carriage of nasal staphylococcus aureus is around 30% in the general population. A Health care worker who has a nasal staph carriage may transmit the infection to patients Common types of nasal staph infections include Nasal vestibulitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Colon- not the correct option. Option C. Vagina - not the correct option. Option D. Throat - not the correct option.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is caused by Staphylococcus:", "options": [{"label": "A", "text": "Scarlet fever", "correct": false}, {"label": "B", "text": "Pemphigus vegetans", "correct": false}, {"label": "C", "text": "Ritter’s disease", "correct": true}, {"label": "D", "text": "Erysipelas", "correct": false}], "correct_answer": "C. Ritter’s disease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ritter’s disease Staphylococcal scalded skin syndrome (SSSS), also known as Ritter von Ritterschein disease (in newborns), Ritter disease, and staphylococcal epidermal necrolysis, encompasses a spectrum of superficial blistering skin disorders caused by the exfoliative toxins of some strains of Staphylococcus aureus. It's usually caused by an infection with a type of Staphylococcal aureus bacteria.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Scarlet fever is a bacterial infection caused by Group A Streptococcus. It mostly affects children. Option D. Streptococci are the primary cause of erysipelas. Most facial infections are attributed to group A streptococci. Option B. Pemphigus vegetans - Pemphigus vegetans is a rare variant of Pemphigus vulgaris characterized by heaped-up, cauliflower-like vegetating plaques in the flexures. Pemphigus vulgaris occurs when the immune system mistakenly makes antibodies against proteins in healthy skin and mucous membranes. The antibodies break down the bonds between the cells, and fluid collects between the layers of the skin. This leads to blisters and erosions on the skin.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25 yr old man with 3 weeks of fever presented with the following pathology as shown in the pictogram. The patient is also an IV drug user. Cause is:", "options": [{"label": "A", "text": "S. aureus", "correct": true}, {"label": "B", "text": "S. epidermidis", "correct": false}, {"label": "C", "text": "S. saprophyticus", "correct": false}, {"label": "D", "text": "E. fecal", "correct": false}], "correct_answer": "A. S. aureus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251447910-QTDV069016IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>S. Epidermidis Staphylococcus epidermidis is a Gram-positive bacterium, which is catalase positive and coagulase-negative and one of over 40 species belonging to the genus Staphylococcus. It is part of the normal human flora, typically the skin flora, and less commonly the mucosal flora. It is a facultative anaerobic bacteria. Epidermidis can cause opportunistic infections, which include particularly biofilm-associated infections on indwelling medical devices. These often can disseminate into the bloodstream; and in fact, S. epidermidis is the most frequent cause of nosocomial sepsis. S. epidermidis is a very hardy microorganism, consisting of nonmotile, Gram-positive cocci, arranged in grape-like clusters. It forms white, raised, cohesive colonies about 1–2 mm in diameter after overnight incubation and is not hemolytic on blood agar.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Staphylococcus epidermidis is a coagulase-negative, gram-positive cocci bacteria that form clusters. It is also a catalase-positive and facultative anaerobe. It can cause vegetation but less commonly than S. aureus Option C. Staphylococcus saprophyticus is a Gram-positive bacterium that is a common cause of uncomplicated urinary tract infections , especially in young sexually active It is also responsible for complications including acute pyelonephritis, epididymitis, prostatitis, and urethritis. Option D. Enterococcus faecalis – formerly classified as part of the group D Streptococcus system – is a Gram-positive, commensal bacterium inhabiting the gastrointestinal tracts of humans. Like other species in the genus Enterococcus, E. faecalis is found in healthy humans and can be used as a probiotic. So, Options B, C, and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Virulence factors of Staphylococcus aureus include all of the following except one. Which one is this exception?", "options": [{"label": "A", "text": "Beta-lactamases", "correct": false}, {"label": "B", "text": "Coagulase", "correct": false}, {"label": "C", "text": "Enterotoxins", "correct": false}, {"label": "D", "text": "M Protein", "correct": true}], "correct_answer": "D. M Protein", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>M Protein M protein is the virulence factor of streptococcus spp and not staphylococcus. Staphylococcus virulence factors Streptococcus virulence factors:</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "About 25% of people and animals have Staph on their skin and in their noses. It usually does not cause illness in healthy people, but Staph has the ability to make toxins that can cause food poisoning. Staphylococci release all these toxins except:", "options": [{"label": "A", "text": "TSST", "correct": false}, {"label": "B", "text": "Leucocidin", "correct": false}, {"label": "C", "text": "Exfoliative toxin", "correct": false}, {"label": "D", "text": "Erythrogenic toxin", "correct": true}], "correct_answer": "D. Erythrogenic toxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Erythrogenic toxin Toxins of Staph aureus Secreted factors Cell-associated factors Superantigens: Toxic shock syndrome toxin-1 Enterotoxins (A to E, G to Q) Exfoliative toxins (A-D) Cytotoxins: α -toxin β-toxin δ-toxin γ-toxin P-V Leukocidin Staphylococcal exotoxin-like proteins Enzymes: Coagulase Ironate lyase Lipases Proteases Staphylokinase Epidermal cell differentiation inhibitors (A–C) Protein A Capsular Polysaccharide Polysaccharide intercellular adhesin Peptidoglycan Adhesins for: Fibronectin Fibrinogen Collagen Elastin Vitronectin von Willebrand factor Bone Sialoprotein Thrombospondin Lactoferrin Plasmin Options A, B, and C. These are the correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Heat stable enterotoxin causing food poisoning are all except which of the following?", "options": [{"label": "A", "text": "Bacillus cereus", "correct": false}, {"label": "B", "text": "Yersinia enterocolitica", "correct": false}, {"label": "C", "text": "Staphylococcus", "correct": false}, {"label": "D", "text": "Clostridium perfringens", "correct": true}], "correct_answer": "D. Clostridium perfringens", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium perfringens Perfringens food poisoning with an incubation period of 9-18 hours and diarrhea as the chief symptom . Perfringens enterotoxin (CPE) are sensitive to heat . Clostridium perfringens food poisoning results from eating food contaminated by the bacterium. Once in the small intestine, the bacterium releases a toxin that often causes diarrhea. Clostridium perfringens is a bacteria that causes several disorders, including gastroenteritis. The high heat resistance of these spores allows them to survive the cooking process, leading to a large number of food-poisoning cases each year. All other options are heat-resistant spores.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A woman had a high fever, hypotension, and a diffuse macular rash. When all cultures showed no bacterial growth, a diagnosis of toxic shock syndrome was made. Regarding the mechanism by which the toxin causes this disease, which one of the following is LEAST accurate?", "options": [{"label": "A", "text": "The toxin is not processed within the macrophage.", "correct": false}, {"label": "B", "text": "The toxin binds to both the class II MHC protein and the T cell receptor.", "correct": false}, {"label": "C", "text": "The toxin activates many CD4-positive T cells, and large amounts of interleukins are released.", "correct": false}, {"label": "D", "text": "The toxin has an A-B subunit structure--the B subunit binds to a receptor, and the A subunit enters the cells and activates them.", "correct": true}], "correct_answer": "D. The toxin has an A-B subunit structure--the B subunit binds to a receptor, and the A subunit enters the cells and activates them.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The toxin has an A-B subunit structure--the B subunit binds to a receptor, and the A subunit enters the cells and activates them. Toxic shock syndrome is a rare, life-threatening complication of certain types of bacterial infections. Often toxic shock syndrome results from toxins produced by Staphylococcus aureus bacteria. Toxic shock syndrome toxin 1 (TSST-1), formerly known as “staphylococcal enterotoxin F,” is the toxin isolated in the majority of STSS cases. Toxic-shock syndrome (TSS) produced an enterotoxin-like protein, tentatively identified as staphylococcal enterotoxin F.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Toxic shock syndrome toxin (TSST) is a superantigen with a size of 22 kDa produced by 5 to 25% of Staphylococcus aureus isolates. The toxin binds to both the class II MHC protein and the T cell receptor. Option C. It causes toxic shock syndrome (TSS) by stimulating the release of large amounts of interleukin-1, interleukin-2, and tumor necrosis factor.</p>\n<p><strong>Extraedge:</strong></p><p>Mecganism of Sugerantigen:</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-year-old I/V drug user presents with a febrile illness that has lasted 2 weeks. He also has C/O dyspnea, cough, arthralgia, diarrhea, and abdominal pain. O/E, a heart murmur is present, small, tender nodules are found on the finger, and small hemorrhages on the palms. Blood cultures are obtained. While awaiting lab confirmation, an empiric antibiotic regimen should primarily be directed at which organisms?", "options": [{"label": "A", "text": "Enterococci", "correct": false}, {"label": "B", "text": "Pseudomonas aeruginosa", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": true}, {"label": "D", "text": "Streptococcus pneumoniae", "correct": false}], "correct_answer": "C. Staphylococcus aureus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Staphylococcus aureus This is a case of Staphylococcal infection followed by endocarditis. Staphylococcus aureus is the most common cause of Bacterial The clinical picture suggests the diagnosis of bacterial endocarditis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Enterococcus is a large genus of lactic acid bacteria of the phylum Bacillota. Enterococci are gram-positive cocci that often occur in pairs (diplococci) or short chains and are difficult to distinguish from streptococci on physical characteristics alone. Option B. Pseudomonas aeruginosa is a common encapsulated, gram-negative, aerobic–facultatively anaerobic, rod-shaped bacterium that can cause disease in plants and animals, including humans. Option D. Streptococcus pneumoniae are lancet-shaped, gram-positive, facultatively anaerobic bacteria with more than 100 known serotypes. Most S. pneumoniae serotypes can cause disease, but only a minority of serotypes produce the majority of pneumococcal infections. Options A, B, and D. Are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis of bacterial endocarditis The Modified Duke Criteria Definitions of Definite, Possible, and Rejected Endocarditis Definite IE Pathologic criteria 1. Microorganisms demonstrated by culture or histologic examination of a vegetation, a vegetation that has embolized, or an intracardiac abscess specimen; or 2. Pathologic lesions; vegetation or intracardiac abscess confirmed by histologic examination showing active endocarditis Clinical criteria 1. Two major criteria 2. One major criterion and three minor criteria 3. Five minor criteria Possible IE 1. One major criterion and one minor criterion 2. Three minor criteria Rejected 1. Firm alternate diagnosis explaining evidence of IE 2. Resolution of infection endocarditis syndrome with antibiotic therapy for ≤4 days 3. No pathologic evidence of IE at surgery or autopsy, with antibiotic therapy for <4 days 4. Does not meet criteria for possible IE, as described previously</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Resistance of Staphylococcus aureus to methicillin is most often caused by:", "options": [{"label": "A", "text": "Alternation of the major target for the drug", "correct": true}, {"label": "B", "text": "Cell membrane impermeability", "correct": false}, {"label": "C", "text": "Decreased uptake of the antibiotic", "correct": false}, {"label": "D", "text": "Inactivation of autolysins", "correct": false}], "correct_answer": "A. Alternation of the major target for the drug", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Alternation of the major target for the drug S. aureus can become r esistant to methicillin and other β-lactam antibiotics through the expression of a foreign PBP , PBP2a, that is resistant to the action of methicillin but can perform the functions of the host PBPs. T he target PBP is altered and thereby the drug is unable to bind. This is controlled by the mecA gene. Methicillin-resistant S. aureus isolates are often resistant to other classes of antibiotics (through different mechanisms) making treatment options limited, and this has led to the search for new compounds active against these strains. Options B, C, and Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Staphylococcus aureus is notorious for its ability to become resistant to antibiotics. Infections caused by antibiotic-resistant strains often occur in epidemic waves initiated by one or a few successful clones. Methicillin-resistant S. aureus (MRSA) is prominently featured during these epidemics. Transfer of drug resistance in Staphylococcus is by:", "options": [{"label": "A", "text": "Transduction", "correct": true}, {"label": "B", "text": "Transformation", "correct": false}, {"label": "C", "text": "Conjugation", "correct": false}, {"label": "D", "text": "Transfection", "correct": false}], "correct_answer": "A. Transduction", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Transduction The bacteriophage-mediated transfer involves both transduction and auto-transduction, which may enable lysogenic S. aureus cells to acquire antibiotic-resistance genes. Bacteriophage transduction was perceived as the primary route of horizontal gene transfer between staphylococci. Bacteriophage transduction greatly increases the speed and ease of S. aureus studies by allowing the movement of chromosomal markers and plasmids between strains.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Transformation - Bacterial transformation is a process of horizontal gene transfer by which some bacteria take up f oreign genetic material (naked DNA) from the environment. It was first reported in Streptococcus pneumoniae by Griffith in 1928. Option C. Bacterial conjugation also referred to as bacterial sex via a pili, is a major horizontal gene transfer mechanism through which DNA is transferred from a donor to a recipient bacterium by direct contact. Option D. Transfection is the process by which foreign DNA is deliberately introduced into a eukaryotic cell through non-viral methods including both chemical and physical methods in the lab.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Image shows the growth of a bacterial isolate on a nutrient agar plate with a disc of novobiocin. What is the likely identity of bacteria growing?", "options": [{"label": "A", "text": "S. aureus or S. saprophyticus", "correct": false}, {"label": "B", "text": "S. saprophyticus or S. xylosus", "correct": false}, {"label": "C", "text": "S. xylosus or S. saprophyticus", "correct": false}, {"label": "D", "text": "S. epidermidis or S. aureus", "correct": true}], "correct_answer": "D. S. epidermidis or S. aureus", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251448381-QTDV069028IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>S. epidermidis or S. aureus The picture shows a novobiocin-sensitive Staph saprophyticus is The disc diffusion method was used for antimicrobial susceptibility testing of the Staphylococcal isolates. S. saprophyticus is intrinsically resistant to novobiocin. So all the options with this isolate are ruled out.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. Are incorrect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Which of the following chemical agents is a powerful oxidizing agent used to kill microorganisms?", "options": [{"label": "A", "text": "Benzoic acid", "correct": false}, {"label": "B", "text": "Chlorine", "correct": true}, {"label": "C", "text": "Ethyl alcohol", "correct": false}, {"label": "D", "text": "Ethylene oxide", "correct": false}], "correct_answer": "B. Chlorine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlorine Chlorine (choice B) is a halogen often used for microbial disinfection and antisepsis. Many compounds can release various forms of chlorine (OCl−, HCl, Cl2) that can kill microorganisms by oxidation . These include sodium hypochlorite, chlorine dioxide, and sodium dichloroisocyanurate, oxidizing agents that destroy the cellular activity of proteins. Hypochlorous acid is the active ingredient for bactericidal and virucidal effects. Such compounds may be sporicidal. Iodine (I2) may also be bactericidal, fungicidal, tuberculocidal, virucidal, and sporicidal. Mercury is antimicrobial but dangerous to humans. Other options do not use oxidation as a mechanism. Ethanol (choice C) has limited killing ability for bacteria. Benzoic acid (choice A) has limited antimicrobial use, while ethylene oxide (choice D) can sterilize (completely kill all organisms) materials, but is very dangerous to humans as well.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old man comes to the physician due to a 2-month history of fatigue, malaise, and abdominal discomfort. He is found to have tender hepatomegaly with elevated liver function tests. The patient has never been vaccinated against hepatitis. He has had no raw or uncooked foods recently and recalls no ill contacts. There is no history of blood transfusion. He smokes two packs of cigarettes daily and consumes 1 or 2 bottles of beer on weekends. The patient does not use illicit drugs. He has had several episodes of unprotected sex with different female partners within the past year. Which of the following is most likely to be present in this patient?", "options": [{"label": "A", "text": "HAV in the stool", "correct": false}, {"label": "B", "text": "Serum anti-HAV lgG", "correct": false}, {"label": "C", "text": "Serum anti-HBsAg lgG", "correct": false}, {"label": "D", "text": "Serum HBsAg", "correct": true}], "correct_answer": "D. Serum HBsAg", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Serum HBsAg The main modes of transmission of hepatitis B virus (HBV) are sexual (communication among heterosexual partners and among men who have sex with men) and percutaneous (e.g., intravenous drug use, needlestick accidents, blood transfusions). Vertical (mother-to-child) transmission is standard in high-prevalence areas. This unvaccinated patient with tender hepatomegaly and liver function abnormalities most likely has acute HBV infection contracted during an episode of unprotected sex ( most common mode of transmission in developed countries, > 70% of cases). Serum hepatitis B surface antigen (HBsAg) would be present.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A and B. Hepatitis A virus (HAV) in the stool or serum anti-HAV lg would be expected with acute HAV following recent travel to an endemic area or consumption of tainted, insufficiently heated food. HAV (fecal-oral transmission) is not usually symptomatic for two months and is not associated with a chronic carrier state. Option C. Anti-HBsAg immunoglobulin G (lgG) appears after successful HBV vaccination or an infection clearance (an indicator of non-infectivity and immunity). Because this patient is symptomatic, he has not cleared the virus and would likely not yet have anti-HBsAg lgG.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which organism would most likely cause infection after a disinfection procedure that killed vegetative cells but did not kill spores?", "options": [{"label": "A", "text": "Chlamydia", "correct": false}, {"label": "B", "text": "Clostridium", "correct": true}, {"label": "C", "text": "Escherichia", "correct": false}, {"label": "D", "text": "Pseudomonas", "correct": false}], "correct_answer": "B. Clostridium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Clostridium Clostridium is a genus of Gram-positive bacteria. This genus includes several significant human pathogens, including botulism and tetanus causative agents. Clostridium perfringens cause many symptoms, from food poisoning to cellulitis, fasciitis, necrotic enteritis, and gas gangrene—clostridium tetani cause tetanus. Clostridium sordellii can cause a fatal infection in sporadic cases after medical abortions. Chemical disinfectants can kill bacteria, but they do not destroy their spores.</p>\n<p><strong>Highyeild:</strong></p><p>Most of the clostridia bear sub-terminal spores except: tetani: Produces spherical and terminal spore (drum stick appearance) tertium: Produces oval and terminal spore (tennis racket appearance) bifermentans: Produces central and oval spore.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. trachomatis attaches to a new host cell as a small spore-like form called the elementary body. The elemental body enters the host cell, surrounded by a host vacuole called an inclusion. Within the inclusion, C. trachomatis transforms into a larger, more metabolically active form called the reticulate body. Option C. Escherichia coli is a non-spore-forming, Gram-negative bacterium, usually motile by peritrichous flagella. Escherichia coli is the most common cause of acute urinary tract infections and urinary tract sepsis. Option D. Pseudomonas aeruginosa is a gram-negative, aerobic, non-spore-forming rod capable of causing various infections in both immunocompetent and immunocompromised hosts.</p>\n<p><strong>Extraedge:</strong></p><p>Spore-forming bacteria Bacillus: Bacillus anthracis Bacillus subtilis Bacillus cereus Bacillus clausii Bacillus halodenitrificans Clostridium: Clostridium botulinum, Clostridium difficile. Clostridium perfringens Thermophilic actinomycetes: Thermoactinomyces vulgaris</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a Sterilising agent?", "options": [{"label": "A", "text": "Lysol", "correct": true}, {"label": "B", "text": "Formalin", "correct": false}, {"label": "C", "text": "Glutaraldehyde", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Lysol", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lysol P henolics as disinfectants: Cresol, xylenol, Lysol, and ortho-phenylphenol are used in laboratories and hospitals. All can retain activity in the presence of organic matter. They are toxic and irritant to the skin, hence used as disinfectants but not as antiseptics. Lysol Disinfectant products are used to kill surface and air bacteria. It is explicitly known for its antiseptic or disinfectant property. 3% of Lysol is used in disinfectants. In hot water, a 3% solution of pure or supinated cresol “lysol” is commonly used as a disinfectant for inanimate objects.</p>\n<p><strong>Highyeild:</strong></p><p>Disinfectants Туре Category Examples Liquids Quaternary ammonium A-33, Hi-Tor Chlorine Chloramine T, Clorox Ethanol Ethyl alcohol Formaldehyde Sterac Glutaraldehyde Cidex Isopropanol Hy-Sine, Ioprep, Mikroklene Phenolic Matar, Hil-Phene, O-syl Gas Ethylene oxide Carboxide, Cryoxide, Steroxide Paraformaldehyde Paraformaldehyde</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options B, C, and D. Sterilant is a chemical applied to inanimate objects to kill all microorganisms and spores. Ethylene oxide, glutaraldehyde, and hydrogen peroxide gas ARE examples of sterilants.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is most effective for sterilizing mattresses and plastic Petri plates?", "options": [{"label": "A", "text": "Chlorine", "correct": false}, {"label": "B", "text": "Glutaraldehyde", "correct": false}, {"label": "C", "text": "Autoclave", "correct": false}, {"label": "D", "text": "Ethylene oxide", "correct": true}], "correct_answer": "D. Ethylene oxide", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ethylene oxide Ethylene oxide sterilization processes are very effective and have the advantage that ethylene oxide can penetrate plastic tubes, and therefore, long plastic boxes can be securely sterilized. Heat- and moisture-labile materials can also be sterilized using radioactive radiation or exposure to ethylene oxide gas. Ethylene oxide (EO or EtO) is a low-temperature gaseous process widely used to sterilize various healthcare products, such as single-use medical devices.</p>\n<p><strong>Highyeild:</strong></p><p>ETO STERILIZATION ETO is a colorless gas that is flammable and explosive. The four essential parameters (operational ranges) are gas concentration (450 to 1200 mg/l); temperature (37 to 63°C); relative humidity (40 to 80%)(water molecules carry ETO to reactive sites); and exposure time (1 to 6 hours).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Chlorine dioxide gas is used to DISINFECT laboratory equipment, surfaces, rooms, and tools. Chlorine dioxide can be used as an oxidizer to disinfectant. It is a powerful oxidizer that kills pathogenic microorganisms such as fungi, bacteria, and viruses. Option B. Glutaraldehyde is used as high-level disinfection and clean heat-sensitive equipment such as bronchoscopes and endoscopes. Option C. An autoclave sterilizes surgical equipment, laboratory instruments, pharmaceutical items, and other materials. It can sterilize solids, liquids, hollows, and tools of various shapes and sizes. Autoclaves vary in size, shape, and functionality.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ethylene Oxide is a highly toxic agent which destroys microorganisms by a process called:", "options": [{"label": "A", "text": "Cavitation", "correct": false}, {"label": "B", "text": "Oxidation", "correct": false}, {"label": "C", "text": "Osmosis", "correct": false}, {"label": "D", "text": "Alkylation", "correct": true}], "correct_answer": "D. Alkylation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Alkylation Ethylene oxide reacts with different chemicals and undergoes a process called alkylation. Alkylation is a chemical reaction replacing a hydrogen atom with a hydroxyethyl radical. This process causes the amino acids found in proteins to change shape. Ethylene oxide can destroy viruses, bacteria, and fungi, including spores. It reacts with protoplasm, DNA, and proteins and deactivates a living organism's enzymes and other biologically essential components. Ethylene oxide is more effective in killing microorganisms under dry conditions.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Is involved in a project to assess the feasibility of applying acoustic cavitation to intracorporeal medical implants and equipment sterilization. Option B. Plasma sterilizes by a process called oxidation. The plasma produces a chemical reaction in which all microorganisms are deactivated. Option C. reverse osmosis uses this technique for the sterilization of water.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Agent used for sterilization, except:", "options": [{"label": "A", "text": "Ethylene oxide", "correct": false}, {"label": "B", "text": "Percholic acid", "correct": true}, {"label": "C", "text": "Gamma radiation", "correct": false}, {"label": "D", "text": "Formaldehyde with low-pressure steam", "correct": false}], "correct_answer": "B. Percholic acid", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Percholic acid Perchloric acid helps prepare perchlorate salts, especially ammonium perchlorate, an important rocket fuel component. Perchloric acid is dangerously corrosive and readily forms potentially explosive mixtures.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Ethylene oxide can destroy most viruses, bacteria, and fungi, including bacterial spores. It reacts with protoplasm, DNA, and proteins and deactivates a living organism's enzymes and other biologically essential components. It is used to sterilize surgical instruments and other areas of hospitals. Option C. Gamma radiation is effective against various microorganisms, including spores. Option D. Low-temperature, steam formaldehyde sterilization, has been effective against vegetative bacteria, mycobacteria.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The most widely used, effective, economical, and reliable method of sterilization used in the health care setting is:", "options": [{"label": "A", "text": "Gas plasma", "correct": false}, {"label": "B", "text": "Ethylene oxide", "correct": false}, {"label": "C", "text": "Peracetic acid", "correct": false}, {"label": "D", "text": "Steam", "correct": true}], "correct_answer": "D. Steam", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Steam Of all the methods available for sterilization, moist heat in the form of saturated steam under pressure is the most widely used and dependable. Steam sterilization is nontoxic, inexpensive, rapidly microbicidal, sporicidal, and rapidly heats and penetrates fabrics. The method of choice for sterilization in most labs is autoclaving , using pressurized steam to heat the material to be sterilized. This is a very effective method that kills all microbes, spores, and viruses, although, for some specific bugs, especially high temperatures or incubation times are required.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Plasma sterilizes by a process called oxidation. The plasma produces a chemical reaction in which all microorganisms are deactivated. The high heat turns the hydrogen peroxide molecules into highly unstable free radicals. Option B. ETO is used in healthcare facilities to sterilize critical items (and sometimes semicritical items) that are moisture or heat sensitive and cannot be fixed by steam sterilization. Option C. Peracetic acid is a highly biocidal oxidizer that maintains its efficacy in organic soil. Peracetic acid removes surface contaminants (primarily protein) on endoscopic tubing. Options A, B, and C. These are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "According to the Spaulding Classification System of Sterilization, All of the following are true except:", "options": [{"label": "A", "text": "Non-critical devices come into contact with intact skin.", "correct": false}, {"label": "B", "text": "Semi-critical equipment needs low-level sterilization.", "correct": true}, {"label": "C", "text": "Semi-critical devices come into contact with non-sterile mucous membranes or non-intact skin.", "correct": false}, {"label": "D", "text": "Cardiac catheter is critical equipment", "correct": false}], "correct_answer": "B. Semi-critical equipment needs low-level sterilization.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Semi-critical equipment needs low-level sterilization. Semi-Critical – Instruments that do not penetrate soft tissues or bone but contact oral tissues. These devices should be sterilized after use unless the instrument is damaged by heat. If this is the case, at a minimum, they should be high-level disinfected. Examples include mirrors and amalgam condensers. Sterilization is achieved by steam under pressure (autoclaving), dry heat, or heat/chemical vapor. Critical instruments include forceps, scalpels, bone chisels, scalers, and burs.</p>\n<p><strong>Highyeild:</strong></p><p>Spaulding's classification of medical devices according to the degree of risk for infection involved Medical device and examples Recommended method Critical device (Enter a normally sterile site Surgical instruments, Eg- cardiac and urinary catheters, implants, eye and dental instruments Heat based sterilization, Chemical sterilant or a high level disinfectant Semicritical device (Comes in contact with mucous membranes or minor skin breaches) Eg-Respiratory therapy equipments, anesthesia equipments, endoscopes, laryngoscope, rectal/vaginal/esophageal probes High level disinfectant Noncritical devices (Comes in contact with intact skin) Recommended method Heat based sterilization, Chemical sterilant or a high level disinfectant High level disinfectant Intermediate level or low-level disinfectant Eg- BP cuff, ECG electrodes, bedpans, crutches, stethoscope, thermometer Intermediate level or low-level disinfectant Noncritical surfaces Less direct contact with patient Eg- Surfaces of medical equipments, examination table, computers Low Level Disnfectant</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. “Non-critical devices” come into contact with intact skin. - True Option C. “Semi-critical devices” come into contact with non-sterile mucous membranes or non-intact skin. - true Option D. Cardiac catheter is critical equipment - true Options A, C, and D. Are factual statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Antiseptic property of bleaching powder is mainly attributed to :", "options": [{"label": "A", "text": "Hypochlorous acid", "correct": true}, {"label": "B", "text": "Hypochlorite", "correct": false}, {"label": "C", "text": "Chlorine", "correct": false}, {"label": "D", "text": "H+ ions", "correct": false}], "correct_answer": "A. Hypochlorous acid", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hypochlorous acid Chlorine reacts with sodium hydroxide to sodium hypochlorite (NaOCl). This is an excellent disinfectant with a sound effect. When bleaching powder dissolves, it reacts with water to under chloric acid (HOCl) and hypochlorite ions (OCl-)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options C and D. It will further produce chlorine gas and hydrogen ions. HOCl, or hypochlorous acid, is a more powerful oxidizer than chlorine and a very effective sanitizing agent. Halogen-releasing agents Chlorine compounds lodine compounds →OCI-, HOCI, CI₂ اد Disinfection, antisepsis Options B, C & D. Are not the most common forms of chlorine oxides responsible for its bleaching effect.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Following are the least susceptible to disinfectants and antiseptics?", "options": [{"label": "A", "text": "Spore", "correct": false}, {"label": "B", "text": "Protozoa", "correct": false}, {"label": "C", "text": "Prions", "correct": true}, {"label": "D", "text": "Fungi", "correct": false}], "correct_answer": "C. Prions", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Prions Prions are misfolded proteins that can transmit their misfolded shape onto normal variants of the same protein. They characterize several fatal and transmissible neurodegenerative diseases in humans and many other animals. Prions are highly resistant to disinfection and sterilization methods used so far. The pathogenic prion protein core (called a prion) consists of 142 amino acids, is resistant to proteolytic enzymes, has a mass of 15 picograms, and is filtrable. Fixed by desiccation or chemicals may retain infectivity for years.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Sterilization destroys spores. It is done at high temperatures and under high pressure. In healthcare settings, instruments are sterilized using an autoclave. Option B. It can be sterilized. Option D . Surface sterilization is generally used for isolating lichen-inhabiting fungi and endophytic fungi, and ethanol and sodium hypochlorite are commonly used as sterilizers. Options A, B, and D. Are not the least affected by disinfectants and antiseptics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ethylene oxide is commonly used for the sterilization of all except-", "options": [{"label": "A", "text": "Respiratory ventilators", "correct": false}, {"label": "B", "text": "Glassware", "correct": true}, {"label": "C", "text": "Rubber tubings and catheters", "correct": false}, {"label": "D", "text": "Prosthetic cardiac valves", "correct": false}], "correct_answer": "B. Glassware", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Glassware The most effective and used method of sterilization of glassware is dry heat treatment using a hot air oven. On exposing the glassware to dry heat, the inhibition in growth occurs due to the denaturation of proteins and oxidation of biomolecules. EtO Sterilization is a low-temperature process (typically between 37 and 63°C) that uses Ethylene Oxide gas to reduce the level of infectious agents. EtO is used in gas form and is usually mixed with other substances, such as CO2 or steam.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. Ethylene Oxide Sterilization for Medical Devices like ventilators, catheters, and prosthetic valves. Ethylene Oxide Sterilization for Medical Devices. Non-contact Infrared Thermometers. Thermal Imaging Systems (Infrared Thermographic Systems / Thermal Imaging Cameras) Liquid Chemical Sterilization. Patient Lifts. Surgical Staplers and Staples. So, Options A, C, and D differ from the correct answer to this question.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the method of choice for sterilization of liquid paraffin:", "options": [{"label": "A", "text": "Flaming", "correct": false}, {"label": "B", "text": "Moist heat", "correct": false}, {"label": "C", "text": "Autoclave", "correct": false}, {"label": "D", "text": "Hot Air Oven", "correct": true}], "correct_answer": "D. Hot Air Oven", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hot Air Oven Hot air oven: It is also called a dry heat sterilizer. The articles should be sterilized at the temperature of 150°C-170°C for 1 hour. Glassware like test tubes, pipettes, flasks and glass syringes, fixed oil glycerine, liquid paraffin, etc., can be sterilized by this method.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Flaming: in this method, the articles should be sterilized on the hot flame of the Bunsen burner, eg, loops used for streaking. Option B & C. Autoclave: this type of sterilization is done by moist heat and steam heat under pressure.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Antiseptics are chemical disinfectants used to prevent infection as they inhibit the growth of microorganisms. Antiseptics are used for:", "options": [{"label": "A", "text": "Disinfection of skin", "correct": true}, {"label": "B", "text": "destruction of all microorganisms", "correct": false}, {"label": "C", "text": "Destruction of pathogenic organisms", "correct": false}, {"label": "D", "text": "Decrease bacterial count from objects", "correct": false}], "correct_answer": "A. Disinfection of skin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Disinfection of skin Antiseptics: Chemical disinfectants that can be safely applied to the skin are called antiseptics or skin disinfectants.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Sterilization: The process by which an article surface or medium is freed of all living microorganisms in the vegetative or spore state -Complete absence of microorganisms. Option C. D isinfection: Destruction or removal of all pathogenic organisms capable of giving rise to infection reduction in the microorganisms to a level deemed no longer harmful to health. Unlike sterilization, disinfection is not sporicidal (it does not kill spores). Option D. Decontamination: The process of rendering an article or area free of danger from contaminants, including microbial chemical, radioactive and other hazards. Extra points: Antisepsis It is defined as the\" Prevention of infection, usually by inhibiting the growth of bacteria in wounds or tissues.\" The best and most commonly used antiseptic is povidone-iodine (betadine). Widely used skin disinfectants for hand washing are povidone-iodine (betadine), chlorhexidine, and isopropyl alcohol. Disinfectants Antimicrobials are applied only to inanimate objects. They are not used for surface disinfection^^ (skin or mucous membrane). Germicides These include both antiseptics and disinfectants.</p>\n<p><strong>Extraedge:</strong></p><p>Term Definition Sterilization A process that destroys or eliminates all forms of microbial life from an object or environment. This includes highly resistant bacterial spores. Disinfection A process that eliminates many or all pathogenic microorganisms, except bacterial spores, from an object or an environment Pasteurization The process of applying heat, usually to milk or cheese, for a specified period for the purpose of killing or retarding the growth of pathogenic bacteria Sanitization The process of applying heat, usually to milk or cheese, for a specified period for the purpose of killing or retarding the growth of pathogenic bacteria Cleaning The removal of visible soil (eg, organic and inorganic material) from objects and surfaces normally accomplished manually or mechanically using water with detergents or enzymatic products. Biocide A chemical or physical agent, usually broad spectrum, that inactivates microorganisms Bactericidal A specific term referring to the property by which a biocide can kill bacteria. Bactericidal action differs from bacteriostasis only in being irreversible (ie, the \"killed\" organism can no longer reproduce even after being removed from contact with the agent). In some cases, the agent causes lysis (dissolution) of the cells; in other cases, the cells remain intact and may even continue to be metabolically active. (The terms fungicidal, sporicidal, and virucidal refer to the property whereby biocides can kill fungi, spores, and viruses, respectively.) Bacteriostatic A specific term referring to the property by which a biocide inhibits bacterial multiplication; upon removal of the agent, multiplication resumes. (The terms fungistatic and sporostatic refer to biocides that inhibit the growth of fungi and spores, respectively.) Septic Characterized by the presence of pathogenic microbes in living tissues or associated fluids. Aseptic Free of, or using methods to keep free of, microorganisms. Antiseptic An agent that destroys or inhibits the growth of microorganisms in or on living tissue or biologic fluids. Preservative A substance added to food products or to an organic solution to prevent chemical change or bacterial action. Antibiotic A natural or semi-synthetic substance that either kills (bactericidal) or inhibits the growth (bacteriostatic) of a bacterium</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a Sterilizing agent?", "options": [{"label": "A", "text": "Lysol", "correct": true}, {"label": "B", "text": "Formalin", "correct": false}, {"label": "C", "text": "Glutaraldehyde", "correct": false}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "A. Lysol", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Lysol Lysol (a phenolic disinfectant) and alcohol (ethyl and isopropyl alcohol) are used as disinfectants.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C. Formalin (as used in fumigation) and glutaraldehyde (Cidex used for scopes) are sporicidal and hence used as chemosterilants. Other chemical agents which are sporicidal are ethylene oxide and hydrogen peroxide Option D. Incorrect as Formalin & Glutaraldehyde are sporicidal agents.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Chlorination does not affect:", "options": [{"label": "A", "text": "Vibrio", "correct": false}, {"label": "B", "text": "HIV", "correct": false}, {"label": "C", "text": "E. coli", "correct": false}, {"label": "D", "text": "Poliovirus", "correct": true}], "correct_answer": "D. Poliovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Poliovirus Routine water chlorination cannot kill poliovirus and hepatitis A virus, cyst of E histolytic and Giardia, and oocysts of Cryptosporidium parvum.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, B & C. Affected by chlorination</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The following agent is recommended and commonly used for disinfection in hospitals against COVID-19:", "options": [{"label": "A", "text": "0.1% sodium hypochlorite", "correct": false}, {"label": "B", "text": "1 % sodium hypochlorite", "correct": true}, {"label": "C", "text": "50% isopropyl alcohol", "correct": false}, {"label": "D", "text": "2 % glutaraldehyde", "correct": false}], "correct_answer": "B. 1 % sodium hypochlorite", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>1 % sodium hypochlorite Freshly prepared 1% sodium hypochlorite and 70% isopropyl/ethyl alcohol is recommended for cleaning and disinfection against COVID-19. No special agents are used against the SARS-CoV-2 virus. All protocols of BMWM 2016 stand good for COVID-19 too.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Recommended concentration is 1% of sodium hypochlorite. Option C. 70% isopropyl/ethyl alcohol is recommended for cleaning and disinfection or in hand rubs. Option D. , 2 % glutaraldehyde, is used to disinfect endoscopes.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Autoclave indicator bacterium is-", "options": [{"label": "A", "text": "Clostridium tetani", "correct": false}, {"label": "B", "text": "stearothermophilus", "correct": true}, {"label": "C", "text": "Bacillus pumilus", "correct": false}, {"label": "D", "text": "Subtilis var niger", "correct": false}], "correct_answer": "B. stearothermophilus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>stearothermophilus The biological control/ indicator bacterium/ efficacy testing bacterium of autoclave is Bacillus stearothermophilus spores. Chemical method- Browne’s tube No.1-black spot Bowie Dick tape-dark brown stripes</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C & D. Other biological controls Option A. Dry heat (hot air oven) -Bacillius subtilis or non toxigenic spores of Clostridium tetani Option C. Ionizing radiation - Bacillus pumilus Option D. Gas sterilization (ethylene oxide)- Bacillus subtilis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Various chemical disinfectants are commonly used in hospitals and laboratories, which need to be tested periodically. Phenol coefficient indicates:", "options": [{"label": "A", "text": "Efficacy of a disinfectant", "correct": true}, {"label": "B", "text": "Dilution of a disinfectant", "correct": false}, {"label": "C", "text": "Purity of a disinfectant", "correct": false}, {"label": "D", "text": "Quantity of a disinfectant", "correct": false}], "correct_answer": "A. Efficacy of a disinfectant", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Efficacy of a disinfectant Testing the efficacy of disinfectants Determination of phenol coefficient: (determined from suspension tests) The phenol coefficient of a disinfectant is calculated by dividing the dilution of the test disinfectant by the dilution of phenol that disinfects under predetermined conditions. There are several methods of testing disinfectants, with their advantages and disadvantages. All these tests can be allocated to one of the following disinfectant tests: carrier test, suspension test, capacity test, practical test, field test, or in-use test.</p>\n<p><strong>Highyeild:</strong></p><p>Types of suspension tests: Rideal -Walker Chick-Martin Volume medium 5.0 ml 10.0 Diluent for test disinfectant Distilled water Water with yeast suspension or feces Reaction temperature 17.5±0.5°C 30°C Organism Salmonella typhi Salmonella typhi, Staphylococcus aureus Sampling times 2.5, 5.0, 7.5, 10.0 min. 30.0 min Calculation of coefficient Dilution test killing in 7.5 mins divided by same for phenol Mean concentration of phenol showing no growth after 30 min. divided by same for test</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Dilution of a disinfectant - incorrect Option C. Purity of a disinfectant- incorrect Option D. Quantity of a disinfectant - incorrect Options B, C & D. Incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Consider the statements about prions - Select the correct answer from the given below code:", "options": [{"label": "A", "text": "Proteinaceous material devoid of detectable amounts of nucleic acid.", "correct": false}, {"label": "B", "text": "Sensitive to proteases, ethanol, and boiling.", "correct": true}, {"label": "C", "text": "Shows a very long incubation period.", "correct": false}, {"label": "D", "text": "Host shows no immune response and no inflammatory response.", "correct": false}], "correct_answer": "B. Sensitive to proteases, ethanol, and boiling.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sensitive to proteases, ethanol, and boiling. These agents are unusually resistant to standard means of disinfection. They are resistant to treatment with formaldehyde (3.7%), urea (8 M), dry heat, boiling, ethanol (50%), proteases, deoxycholate (5%), and ionizing radiation. However, they are sensitive to phenol (90%), household bleach, ether, NaOH (2 N), strong detergents (10% sodium dodecyl sulfate), and autoclaving (1 hour, 121°C). Guanidine thiocyanate is highly effective in decontaminating medical supplies and instruments.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option D. The host shows no inflammatory response and no immune response (the agents do not appear to be antigenic); no interferon production is elicited; and there is no effect on host B-cell or T-cell function. Immunosuppression of the host does not affect pathogenesis; however, chronic inflammation induced by other factors (viruses, bacteria, autoimmunity) may affect prion pathogenesis. It has been observed that prions accumulate in organs with chronic lymphocytic inflammation. When coincident with nephritis, prions are excreted in the urine. Option A and C. Correct statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 30 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Which of the following is the best test to know the activity of an unknown disinfectant?", "options": [{"label": "A", "text": "MIC test", "correct": false}, {"label": "B", "text": "Rideal Walker test", "correct": false}, {"label": "C", "text": "Chick Martin test", "correct": true}, {"label": "D", "text": "‘In use’ test of Maurer", "correct": false}], "correct_answer": "C. Chick Martin test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chick Martin test Chick-Martin test. An obsolete method for determining the in vitro efficacy of a disinfectant. The Chick-Martin test is designed to imitate the conditions under which disinfectants are used. Still, it begins by converting highly appropriate organic matter into a material unknown outside the laboratory. Chick-Martin Test for Disinfectants of distilled water shall be added to 0-15 g—dried feces in tubes, which are then autoclaved.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The Minimum Inhibitory Concentration (MIC) tests determine the lowest concentration of an antimicrobial agent needed to inhibit the visible in-vitro growth of a challenging microorganism. Option B. The Rideal-Walker test is a measure of the total possible. germicidal work a disinfectant can do in terms of an arbitrary. standard whose absolute value is unknown. This work is done under fixed temperatures and time conditions on a fixed working schedule. Option D. The “in-use” (Kelsey–Maurer) test is a test that determines whether the chosen disinfectant is effective, in actual use, in hospital practice, and also for the period of its use.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Best method of sterilization by steam under pressure:", "options": [{"label": "A", "text": "Hot air oven", "correct": false}, {"label": "B", "text": "Boiling", "correct": false}, {"label": "C", "text": "Autoclaving", "correct": true}, {"label": "D", "text": "Tyndallization", "correct": false}], "correct_answer": "C. Autoclaving", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Autoclaving Autoclaving is a sterilization method that uses high-pressure steam. The autoclaving process works by the concept that the boiling point of water or steam increases when it is under pressure. Autoclaves can inactivate fungi, bacteria, spores, viruses, and other microorganisms on surgical instruments such as scalpels, forceps, scissors, and other metal items. It is environmentally friendly because autoclaving sterilizes without reagents and allows lab equipment and supplies to be reused. Autoclave</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following items could be sterilized by dry heat sterilization?", "options": [{"label": "A", "text": "Intravenous (IV) solution", "correct": false}, {"label": "B", "text": "Plastic IV bags", "correct": false}, {"label": "C", "text": "Glass pipettes", "correct": true}, {"label": "D", "text": "Rubber gloves", "correct": false}], "correct_answer": "C. Glass pipettes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Glass pipettes When sterilizing glassware such as bottles, Petri dishes, and test tubes, dry heat is required, which is carried out in a hot air oven. First, substitute the cotton plug on the mouth side to sterilize a pipette. Then wrap the pipette in aluminum foil to preserve sterility until you use it. Place in the oven and slowly raise the temperature to 170°, then keep for 45 minutes. They prevent the breakage of costly pipets and Glass tubes during sterilization by autoclaving or dry heat. The ideal temperature of the oven needs to reach at l east 160°C, and the contents need to be regulated at this heat for 45 to 60 minute</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. To ensure patient safety, parenteral/injectable drug products must be sterilized to destroy potential microbial contaminants (fungi, bacteria). The most common sterilization method involves heating under pressure in the presence of water to generate steam. Option B. Because IV fluids are almost solely sterilized by smoke, the materials must withstand temperatures of 110–125 °C / 230–260 °F very well. Option D. The sterilization of surgical rubber gloves and plastic tubing using ionizing radiation</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pasteurized milk is tested most commonly by:", "options": [{"label": "A", "text": "Phosphatase test", "correct": true}, {"label": "B", "text": "Coliform test", "correct": false}, {"label": "C", "text": "Catalase test", "correct": false}, {"label": "D", "text": "Methylene blue test", "correct": false}], "correct_answer": "A. Phosphatase test", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Phosphatase test A lkaline Phosphatase is an enzyme naturally present in milk but destroyed at a temperature near the pasteurization temperature. The Alkaline Phosphatase test indicates whether milk has been adequately pasteurized or has been contaminated with raw milk after pasteurization. So, the ALP test in pasteurized milk is used to verify if the heating process of pasteurization is done correctly.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Coliform test - C oliform detection in milk usually indicates poor plant hygiene. Coliform bacteria are generally killed by the hot water used to clean the plant. However, incorrect cleaning can lead to the rapid growth of the bacteria. The test for coliforms involves aliquoting a sample of milk onto an agar plate. Option C. T he catalase test has been used for many years to measure milk's leucocyte content . This test is based on the decomposition of hydrogen peroxide by the enzyme catalase in milk. Milk typically contains some catalase. However, udder infections increase the catalase activity of milk. Option D. The removal of the oxygen from milk during bacterial metabolism causes the oxidized methylene blue color to disappear . The more bacteria, the quicker the milk changes to evident and the poorer the milk quality. Differences between bacterial endotoxins and exotoxins Endotoxins Exotoxins Lipopolysaccharides in nature Protein in nature Part of Gram-negative bacterial cell wall Secreted both by Gram-positive and negative bacteria; diffuse into surrounding medium Released by cell lysis, Not by secretion Actively secreted by the bacteria Highly stable Heat labile destroyed at 60 Deg C Mode of action - Induces ↑IL-1 and TNF Mostly enzyme like action Nonspecific (fever, shock, etc.) Specific action on particular tissues No specific affinity for tissues Specific affinity for tissues Only large doses are fatal More potent, even smaller doses fatal Poorly antigenic Highly antigenic Neutralization by antibodies is ineffective Neutralized by specific antibodies No effective vaccine is available using endotoxin Toxoid forms are used as vaccine, e.g. tetanus toxoid</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The sterilization method for the instruments which are damaged by dry/moist heat is?", "options": [{"label": "A", "text": "Steam", "correct": false}, {"label": "B", "text": "Radiation", "correct": true}, {"label": "C", "text": "Boiling", "correct": false}, {"label": "D", "text": "Burning", "correct": false}], "correct_answer": "B. Radiation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Radiation Ionizing radiations: Examples include X-rays, gamma rays (from Cobalt 60 source), and cosmic rays. Mechanism: It causes breakage of DNA without temperature rise (hence called cold sterilization). It destroys spores and vegetative cells but is not effective against viruses. It is used for: Disposable plastics, e.g., rubber or plastic syringes, infusion sets, and catheters. Catgut sutures, bone and tissue grafts, adhesive dressings, antibiotics, and hormones. Advantages of Ionizing radiation: High penetrating power, The rapidity of action, and Temperature is not raised Sterilization control: The efficacy of ionizing radiation is tested using Bacillus pumilus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Autoclaves are also known as steam sterilizers and are typically used for healthcare or industrial applications. An autoclave is a machine that uses steam under pressure to kill harmful bacteria, viruses, fungi, and spores on items placed inside a pressure vessel. Option C. Electric steamers plug into outlets and use high temperatures and steam to kill germs; like boiling water, sterilizing works by raising temperatures to kill bacteria. Several different types of sterilizers, including microwave-friendly ones, are available on the market. Option D. Incineration is a waste treatmen t process involving the combustion of organic substances in waste materials. This method also burns any organism to ash. It sterilizes medical and other biohazardous waste before discarding it with non-hazardous waste. Options A, C, and D. All are processes involving heat or a temperature rise, so they are not preferred.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Irradiation can be used to sterilize all except:", "options": [{"label": "A", "text": "Bone graft", "correct": false}, {"label": "B", "text": "Suture", "correct": false}, {"label": "C", "text": "Artificial tissue graft", "correct": false}, {"label": "D", "text": "Bronchoscope", "correct": true}], "correct_answer": "D. Bronchoscope", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bronchoscope The agent recommended for chemical disinfection of fiberoptic bronchoscopes is a 2% glutaraldehyde solution; the instrument should be immersed in it for 10 to 30 minutes. Gamma irradiation is a physical/chemical means of sterilization because it kills bacteria by breaking down bacterial DNA, inhibiting bacterial division. The energy of gamma rays passes through the equipment, disrupting the pathogens that cause contamination.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C. Gamma sterilization is used to sterilize human tissue grafts: connective tissue allografts, such as bone, suture, cartilage, tendons, ligaments, dura mater, skin, heart valves, and corneas, which are widely used for reconstructive surgery in many clinical disciplines.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Heat labile instruments for 'use in surgical procedures can be best sterilized by:", "options": [{"label": "A", "text": "Absolute alcohol", "correct": false}, {"label": "B", "text": "Alpha rays", "correct": false}, {"label": "C", "text": "Chlorine-releasing compounds", "correct": false}, {"label": "D", "text": "Ethylene oxide gas", "correct": true}], "correct_answer": "D. Ethylene oxide gas", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ethylene oxide gas Ethylene oxide (EO or EtO) is a low-temperature gaseous process widely used to sterilize various healthcare products, such as single-use medical devices.</p>\n<p><strong>Highyeild:</strong></p><p>Ethylene Oxide (EtO) is a standard gas used for low-temperature sterilization. It is most commonly used to sterilize instruments with long lumens, such as endoscopes and all materials that must be fixed but cannot withstand higher temperatures. EtO process temperatures from 25 - 55°C are used. It is most commonly used to sterilize instruments. Heat- and moisture-labile materials can also be sterilized using radioactive radiation or exposure to ethylene oxide gas. For sterilizing surgical instruments: Most medical and surgical devices are made of heat-stable materials and, therefore, can be sterilized best by an autoclave (moist heat). Heat labile instruments (e.g., plastics) can be sterilized by Ethylene oxide gas or other new, low-temperature sterilization systems (e.g., hydrogen peroxide gas plasma, peracetic acid immersion, ozone). Dry-heat sterilizers such as hot air ovens should be used only for materials damaged by moist heat or impenetrable to sweltering heat (e.g., powders, petroleum products, sharp instruments).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Higher concentrations cause an external injury that forms a protective wall and shields the organism. Furthermore, 99% isopropanol evaporates very quickly, which does not allow it to penetrate cell walls and kill bacteria, and therefore isn't as suitable for disinfecting surfaces. Option B. Ionizing radiation: Alpha rays are not used for sterilization. Option C. Chlorine-releasing compounds, or chlorine base compounds, are jargon to describe certain chlorine-containing substances used as disinfectants and bleaches. They include the following chemicals: sodium hypochlorite (the active agent in bleach), chloramine, halazone, and sodium dichloroisocyanurate. So, Options A, B, and C differ from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True about the temperature under which the following instrument is used:", "options": [{"label": "A", "text": "115 degrees C for 20 min", "correct": false}, {"label": "B", "text": "121-degree C for 15 min", "correct": true}, {"label": "C", "text": "118-degree C for 15 min", "correct": false}, {"label": "D", "text": "124-degree C for 15 min", "correct": false}], "correct_answer": "B. 121-degree C for 15 min", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689244683937-QTDV041008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>121-degree C for 15 min An autoclave is a machine that uses steam under pressure to kill harmful bacteria, viruses, fungi, and spores on items placed inside a pressure vessel. The items are heated to an appropriate sterilization temperature for a given time. To be effective, the autoclave must reach and maintain a temperature of 121 degrees C for at least 15 minutes by using saturated steam under at least 15 psi of pressure. Increased cycle time may be necessary depending upon the make-up and volume of the load. Media sterilization of 121 degrees C for 15 minutes 15-minute exposure time is for the media temperature once it hits 121 degrees C. At 121 degrees C, the autoclaving time to achieve sterilization is 15- 20 min, depending on the load volume.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following serve as a control for cold sterilization:", "options": [{"label": "A", "text": "Bacillus globigii", "correct": false}, {"label": "B", "text": "Bacillus stearothermophilus", "correct": false}, {"label": "C", "text": "Bacillus pumilus", "correct": true}, {"label": "D", "text": "Bacillus subtilis", "correct": false}], "correct_answer": "C. Bacillus pumilus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacillus pumilus Bacillus pumilus is a Gram-positive, aerobic, spore-forming bacillus commonly found in soil. B. pumilus spores, except the mutant strain, generally show high resistance to environmental stresses, including UV light exposure, desiccation, and oxidizers such as hydrogen peroxide. Bacillus pumilus is a spore-forming bacteria that is rod-shaped, Gram-positive, and aerobic. It resides in soils, and some colonize in the root area of some plants. Cold plasma sterilization is an emerging non-thermal technology receiving significant attention in food processing. Survival curves of Bacillus pumilus spores were obtained after spore strip samples containing an initial spore population.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It is used for drinking water and wastewater treatment, air disinfection, and commodity treatment Option B. Use an autoclave as a control. Option D. Biological indicators, or spore tests, are the most accepted means of monitoring sterilization because they assess the sterilization process directly by killing known highly resistant microorganisms (e.g., Geobacillus or Bacillus species). Options A, B, and D. Are different from the correct answer.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following sterilization process uses hydrogen peroxide and radiofrequency emissions:", "options": [{"label": "A", "text": "Cold sterilization", "correct": false}, {"label": "B", "text": "Autoclave", "correct": false}, {"label": "C", "text": "Gas plasma sterilization", "correct": true}, {"label": "D", "text": "Endoclens", "correct": false}], "correct_answer": "C. Gas plasma sterilization", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gas plasma sterilization The system uses hydrogen peroxide as the substrate gas and radio frequency emissions to generate plasma. This system is a low-temperature, quick-acting process with no toxic residues. This sterilizer system is promising in healthcare and could help reduce ethylene oxide use. By-products of plasma sterilization are primarily water and oxygen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Uses radiation. Option B. Autoclaves for Medical Waste. Autoclaves are closed chambers that apply heat and sometimes pressure and steam over some time to sterilize medical equipment. Option D. Endoclens: A New Liquid Chemical Sterilization System. The system is designed to provide rapid, automated, point-of-use chemical sterilization of flexible endoscopes. It consists of a computer-controlled endoscope-reprocessing machine and a new, proprietary liquid sterilant that uses performic acid.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "This is the symbol for:", "options": [{"label": "A", "text": "Biohazard", "correct": true}, {"label": "B", "text": "Chemical hazard", "correct": false}, {"label": "C", "text": "Cytotoxic hazard", "correct": false}, {"label": "D", "text": "Radiation hazard", "correct": false}], "correct_answer": "A. Biohazard", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689244684153-QTDV041011IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Biohazard A biological hazard, or biohazard, is a natural substance that threatens the health of living organisms, primarily humans. This could include a sample of a microorganism, virus, or toxin that can adversely affect human health. A biohazard could also be a substance harmful to other animals. Examples include human and animal blood, tissues, certain body fluids, recombinant DNA, and human, animal, or plant pathogens.” In layman's terms, biohazardous waste is any waste contaminated with potentially infectious materials. The term \"biohazard\" for this symbol is defined as \"those infectious agents presenting a risk or potential risk to the well-being of man, either directly through his infection or indirectly through disruption of his environment.\"</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D - Radiation hazard - T-red color. Option B - chemical hazard - Option C - Cytotoxic hazard -</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A chemical or physical agent, usually broad spectrum, that inactivates microorganisms is:", "options": [{"label": "A", "text": "Bactericidal", "correct": false}, {"label": "B", "text": "Bacteriostatic", "correct": false}, {"label": "C", "text": "Biocide", "correct": true}, {"label": "D", "text": "Aseptic", "correct": false}], "correct_answer": "C. Biocide", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Biocide A chemical or physical agent that inactivates microorganisms, usually broad spectrum.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Bactericidal refers to the property by which a biocide can kill bacteria. Bactericidal action differs from bacteriostasis only in irreversible (i.e., the “killed” organism can no longer reproduce even after being removed from contact with the agent). In some cases, the agent causes lysis (dissolution) of the cells; in other cases, the cells remain intact and may continue to be metabolically active. (The terms fungicidal, sporicidal, and virucidal refer to the property whereby biocides can kill fungi, spores, and viruses, respectively.) Option B. Bacteriostatic refers to the property by which a biocide can inhibit bacterial multiplication; multiplication resumes upon removal of the agent. (The terms fungistatic and prostatic refer to biocides that inhibit the growth of fungi and spores, respectively.) Septic is Characterized by pathogenic microbes in living tissues or associated fluids Option D. Aseptic - Free of, or using methods to keep free of, microorganisms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Identify the following instrument:", "options": [{"label": "A", "text": "Hot Air oven", "correct": false}, {"label": "B", "text": "Autoclave", "correct": true}, {"label": "C", "text": "Bunsen Burner", "correct": false}, {"label": "D", "text": "Radiation", "correct": false}], "correct_answer": "B. Autoclave", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689244684166-QTDV041015IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Autoclave Autoclave: this type of sterilization is done by steam heat under pressure. Use: surgical dressing, surgical instruments, etc., are sterilized by this method(Autoclaved).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Hot air oven is also called a dry heat sterilizer. The articles should be sterilized at the temperature of 150°C-170°C for 1 hour. Glassware like test tubes , pipettes, flasks and glass syringes, fixed oil glycerin, liquid paraffin, etc., can be sterilized by this method. Option C. Flaming: in this method, the articles should be sterilized on the hot flame of the Bunsen burner. Option D. Radiation is used for the sterilization of heat-labile instruments.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Plasma sterilization accuracy is assessed by using?", "options": [{"label": "A", "text": "Bacillus subtilis", "correct": false}, {"label": "B", "text": "Bacillus stearothermophilus", "correct": true}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Clostridium tetani", "correct": false}], "correct_answer": "B. Bacillus stearothermophilus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacillus stearothermophilus A plasma is an excited gas produced by adding energy (radiofrequency or microwaves). It operates differently using specific active agents like UV photons and radicals (atoms or assembly of atoms with unpaired electrons, therefore chemically reactive, e.g., O and OH, respectively). Paper products cannot be sterilized. Objects to be fixed should be dry. Bacillus determining the efficacy spores of Bacillus stearothermophilus are used as the test organism. Other biological controls</p>\n<p><strong>Highyeild:</strong></p><p>Gas plasmas are generated in an enclosed chamber under a deep vacuum using r adio frequency or microwave energy to excite the gas molecules and produce charged particle s, many of which are free radicals that disrupt the metabolism of microorganisms. The by-products of the cycle (e.g., water vapor, oxygen) are nontoxic and eliminate the need for aeration. The process operates in the range of 37-44oC and has a cycle time of 75 minutes. They are used to sterilize heat-sensitive materials like plastics and corrosion-susceptible metallic instruments.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A & D. Dry heat (hot air oven) - Bacillus subtilis or nontoxigenic spores of Clostridium tetani Gas sterilization (ethylene oxide)- Bacillus subtilis Plasma sterilization – Bacillus stearothermophilus Option C. Staphylococcus aureus is not used as a biological control for any sterilization method.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is correct for the definition of Tyndallization?", "options": [{"label": "A", "text": "A method of preserving cultures", "correct": false}, {"label": "B", "text": "A method of injection of media", "correct": false}, {"label": "C", "text": "A method of growing bacteria in pure culture", "correct": false}, {"label": "D", "text": "A method of sterilization", "correct": true}], "correct_answer": "D. A method of sterilization", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A method of sterilization Tyndallization Tyndallization is carried out in a Koch and Arnold steam sterilizer. Media that contain any ingredient/component not able to tolerate the temperature of an autoclave are sterilized by Tyndallization—Eg. TCBS , XLD, DCA, sugar solutions for fermentation tests, and gelatin-containing media. The underlying principle is that the vegetative forms of bacteria are destroyed at 100°C while the bacterial spores survive. These spores germinate and are killed on subsequent heating.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Freeze-drying (lyophilization) is one of the most economical and effective methods for the preserving bacteria and other microorganisms long-term . Two of the most common methods used are centrifugal freeze-drying and freezing. Option B. Inoculate culture media directly by rolling the cannulae across the surface of a whole agar plate five times (avoiding the edges of the plate) or culture any blood, fluid, or material contained in or on the specimen Option C. The most common method to isolate individual cells and produce a pure culture is to prepare a streak plate. The streak plate method is a way to separate the microbial population physically. It spreads the inoculate back and forth with an inoculating loop over the solid agar plate. Option A, B & C. Incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is a false statement ?", "options": [{"label": "A", "text": "Glutaraldehyde is effective against tubercle bacilli", "correct": false}, {"label": "B", "text": "Holder method of pasteurization is heating at 63°C for 4-5 minutes", "correct": true}, {"label": "C", "text": "Flash method has a cooling component", "correct": false}, {"label": "D", "text": "All are true", "correct": false}], "correct_answer": "B. Holder method of pasteurization is heating at 63°C for 4-5 minutes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Holder method of pasteurization is heating at 63°C for 4-5 minutes Option B & C. Pasteurization is a method of disinfection of milk. a.Holder method: 63°C for 30minutes. b. Flash method: 72°C for 15 seconds followed by rapid cooling till 4°C. Option a: Gluteraldehyde is a sporicidal agent, action includes bactericidal activity Option d: Incorrect</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 26 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 36-year-old man is admitted to the hospital with severe left leg pain after suffering a minor laceration to his leg 2 days earlier. His temperature is 39.5 C (103 F) and his blood pressure is 85/45 mm Hg. On physical examination, the patient's left leg is swollen and firm with erythema of the overlying skin. There is a small wound draining blood-tinged exudate on his left calf. The patient is taken to the operating room immediately and a large area of necrotic tissue is excised. Gram stain of the necrotic tissue shows Gram-positive cocci and culture of the bacteria performed on a blood agar plate grows small colonies with a wide zone of surrounding hemolysis. Coagulase and catalase tests are negative and the pyrrolidone arylamidase (PYR) test is positive. Which of the following pathogens is most likely responsible for this patient's condition?", "options": [{"label": "A", "text": "Streptococcus pyogenes", "correct": true}, {"label": "B", "text": "Streptococcus agalactiae", "correct": false}, {"label": "C", "text": "Staphylococcus aureus", "correct": false}, {"label": "D", "text": "Clostridium perfringens", "correct": false}], "correct_answer": "A. Streptococcus pyogenes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus pyogenes This patient has necrotizing fasciitis (\"flesh-eating disease\") , a severe soft-tissue infection characterized by fulminant tissue necrosis and high mortality. The microbiologic differential for this condition includes Streptococcus pyogenes, Staphylococcus aureus, Clostridium perfringens, Streptococcus agalactiae, and Aeromonas hydrophila. Of these options, S pyogenes (group A strep) is the only Gram-positive cocci that is coagulase-negative, catalase-negative, and pyrrolidone arylamidase (PYR)-positive.</p>\n<p><strong>Highyeild:</strong></p><p>Streptococcus pyrogens: It forms small colonies with a wide zone of beta hemolysis and is sensitive to bacitracin (which has been widely replaced by the PYR test). S pyogenes can be transmitted through wounds and spread rapidly to the deep layers of the skin and fascia due to the production of hyaluronidase and other hydrolytic enzymes. M protein is another major virulence factor that allows the bacteria to evade phagocytosis by preventing activation of the alternate complement pathway. The bacterium also secretes a multitude of extracellular toxins, including hemolysins O and S (cytotoxins that cause hemolysis) and pyrogenic exotoxins (superantigen s that result in tissue injury and septic shock). Typically, there is a sudden onset of severe pain and swelling at a site of trauma or recent surgery. Patients quickly become hypotensive and develop septic shock. Necrotizing fasciitis is initially treated with aggressive surgical debridement of all necrotic tissue along with empiric broad-spectrum antibiotics due to the high incidence of polymicrobial infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. S agalactiae (group B strep) is a coagulase- and catalase-negative, Gram-positive cocci that grow in chains. Colonies produce a narrow zone of beta-hemolysis that enhances when plated perpendicular to the S aureus (positive CAMP test). S agalactiae can cause skin and soft tissue infections as well as newborn sepsis and meningitis. Option C. S aureus is a Gram-positive coccus that grows in clusters. It is catalase-positive, coagulase-positive, and PYR-positive. S aureus produces large golden-colored colonies and demonstrates beta-hemolysis. Like S pyogenes, S aureus can also cause monomicrobial necrotizing fasciitis. Option D. C perfringens is a large, spore-forming, Gram-positive rod that is a strict It is implicated in food poisoning, clostridial myonecrosis (gas gangrene), and bacteremia. On blood agar, it produces a double zone of beta-hemolysis (target hemolysis)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following organism appear as diplococci with adjacent sides flattened:", "options": [{"label": "A", "text": "Neisseria meningitidis", "correct": true}, {"label": "B", "text": "Neisseria gonorrhoeae", "correct": false}, {"label": "C", "text": "Corynebacterium diphtheriae", "correct": false}, {"label": "D", "text": "Enterococcus faecalis", "correct": false}], "correct_answer": "A. Neisseria meningitidis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Neisseria meningitidis Neisseria meningitides, often referred to as meningococcus, is a Gram-negative bacterium that can cause meningitis and other forms of meningococcal disease such as meningococcemia, and life-threatening sepsis. Meningitidis are gram-negative, diplococci that may occur intracellularly or extracellularly in PMN leukocytes. It is a Gram-negative, non-spore-forming, non-motile, encapsulated, and non-acid-fast diplococci, which appears in kidney bean shape under the microscope</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Coffee-bean shaped Option C. Club-shaped bacillus, gram-positive, Chinese pattern appearance Option D. Gram-positive paired Cocci that are spherical or ovoid, angulated at an angle towards each other. can also be seen in chains.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statement about Neisseria is not true:", "options": [{"label": "A", "text": "Require carbon dioxide for growth", "correct": false}, {"label": "B", "text": "They are gram positive cocci", "correct": true}, {"label": "C", "text": "Thayer-Martin is a selective medium for growth", "correct": false}, {"label": "D", "text": "They are cold sensitive", "correct": false}], "correct_answer": "B. They are gram positive cocci", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>They are gram positive cocci Neisseria are gram-negative cocci that are commonly associated with human diseases.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and Are correct.</p>\n<p><strong>Extraedge:</strong></p><p>Thayer Martin Agar (Modified) contains hemoglobin, which provides the X factor (hemin), and GCHI Enrichment, which provides the V factor, vitamins, amino acids, coenzymes, and dextrose. Vancomycin and colistin are selective agents which inhibit gram-positive cocci and gram-negative bacilli, respectively.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which among the following is bile esculin positive and shows growth in 6.5% sodium chloride?", "options": [{"label": "A", "text": "Strep agalactiae", "correct": false}, {"label": "B", "text": "Strep pneumoniae", "correct": false}, {"label": "C", "text": "Enterococcus faecalis", "correct": true}, {"label": "D", "text": "Strep viridians", "correct": false}], "correct_answer": "C. Enterococcus faecalis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterococcus faecalis Enterococcus faecalis is a gram-positive bacterium that can cause a variety of nosocomial infections of which urinary tract infections are the most common. Enterococcus faecalis hydrolyzes esculin in the presence of bile and turns more than half the medium dark brown. This is a positive result. It is bile-esculin-positive and grows in the 6.5% NaCl broth. Heat tolerance test: They are relatively heat resistant, and can survive 60°C for 30 minutes.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Group B Streptococcus (group B strep) or S. agalactiae is a species of bacterium that causes illness in people of all ages. Also known as GBS, this bacterium is a common cause of severe infections in newborns during the first week of life. Option B. Streptococcus pneumoniae is lancet-shaped, gram-positive, facultatively anaerobic bacteria with more than 100 known serotypes. Most S. pneumoniae serotypes can cause disease, but only a minority of serotypes produce the majority of pneumococcal infections. Option D. The viridans streptococci are a large group of commensal streptococcal Gram-positive bacteria species that are α-hemolytic, producing a green coloration on blood agar plates, although some species in this group are γ-hemolytic, meaning they produce no change on blood agar. Options A, B, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The quellung reaction also called the Neufeld reaction, is a biochemical reaction in which antibodies bind to the bacterial capsule of:", "options": [{"label": "A", "text": "Strep pneumoniae", "correct": true}, {"label": "B", "text": "Neisseria sicca", "correct": false}, {"label": "C", "text": "HemophiluS ducreyi", "correct": false}, {"label": "D", "text": "Strep agalactiae", "correct": false}], "correct_answer": "A. Strep pneumoniae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Strep pneumoniae The quellung reaction, also called the Neufeld reaction, is a biochemical reaction in which antibodies bind to the bacterial capsule of Streptococcus pneumoniae and Haemophilus influenzae.</p>\n<p><strong>Highyeild:</strong></p><p>Quellung Reaction When pneumococci are mixed with specific anti-polysaccharide serum —or with polyvalent antiserum—on a microscope slide, the capsule swells markedly, and the organisms agglutinate by cross-linking of the antibodies . This reaction is used for rapid identification and for typing in sputum or cultures. The polyvalent antiserum, which contains antibodies to all of the types (“omnium”), is a good reagent for rapid microscopic determination of whether or not pneumococci are present in fresh sputum. This test is rarely used and has a historical value in today’s diagnosis because of the high reagent costs and expertise required for interpretation.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 28-yrs-old menstruating woman appeared in the emergency room with the following signs and symptoms: fever, 104oF; WBC, 16,000; BP, 90/65 mmHg; a scarlatiniform rash on her trunk, palms, and soles; extreme fatigue; vomiting; and diarrhea. The patient described in this case most likely has which of the following?", "options": [{"label": "A", "text": "Chickenpox", "correct": false}, {"label": "B", "text": "Guillain – Barre syndrome", "correct": false}, {"label": "C", "text": "Scaled skin syndrome", "correct": false}, {"label": "D", "text": "Toxic shock syndrome", "correct": true}], "correct_answer": "D. Toxic shock syndrome", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689251566164-QTDV070007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Toxic shock syndrome The Key Word In This ques is menstruating female with the clinical picture of shock. Menstruation is associated with Tampon use , which is notorious to cause STAPHYLOCOCCUS AUREUS infection associated with TSST. Scarlatiniform Rash-The rash begins 1–2 days following the onset of symptoms caused by strep pharyngitis (sore throat, fever, fatigue). This characteristic rash has been denoted as \"scarlatiniform,\" and it appears as a diffuse redness of the skin with small papules, or bumps, which resemble goose bumps. The symptoms of Toxic Shock Syndrome may include a sudden high fever, nausea, vomiting, diarrhea, abnormally low blood pressure (hypotension), and a characteristic skin rash that resemble a bad sunburn.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. The rash looks like a sunburn and feels like sandpaper. It typically begins on the face or neck and spreads to the trunk, arms, and legs. If pressure is applied to the reddened skin, it will turn pale. Option B. Guillain-Barré syndrome (GBS) is a rare disorder where the body's immune system damages nerves. The damage to the nerves causes muscle weakness and sometimes paralysis. While its cause is not fully understood, the syndrome often follows infection with a virus or bacteria. Option A. The itchy blister rash caused by chickenpox infection appears 10 to 21 days after exposure to the virus and usually lasts about five to 10 days. Options A, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Streptococcus pyogenes is a species of Gram-positive, aerotolerant bacteria in the genus Streptococcus. These bacteria are extracellular and made up of non-motile and non-sporing cocci (round cells) that tend to link in chains. Transport media for Streptococcus pyogenes is:", "options": [{"label": "A", "text": "Pike's medium", "correct": true}, {"label": "B", "text": "Blood agar", "correct": false}, {"label": "C", "text": "Ludlams medium", "correct": false}, {"label": "D", "text": "Chocolate agar", "correct": false}], "correct_answer": "A. Pike's medium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pike's medium Pike's medium is used to transport streptococci from throat specimens. Transport media are essentially solutions of buffers with carbohydrates, peptones, and other nutrients (excluding growth factors) designed to preserve the viability of bacteria during transport without allowing their multiplication.</p>\n<p><strong>Highyeild:</strong></p><p>Transport media: The primary objective of using the transport medium is to maintain the specimen as near its original state as possible. The transport medium aims to preserve a specimen and minimize bacterial overgrowth from the time of collection to the processing. Amies And Stuart Media : Vaginal pathogens. Commonly used transport media for enteric pathogens: Cary Blair media, VR media, Alkaline peptone water, buffered glycerol saline.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Blood agar is an enriched culture media Option C. (Ludlam’s media- Tellurite glycine agar base )It is used for the quantitative detection of coagulase-positive staphylococci from foods and other sources like skin, mucous membranes, air, soil, etc. Option D. Chocolate agar is used for growing fastidious respiratory bacteria, such as Haemophilus influenzae and Neisseria meningitidis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 11-year-old child has presented with a sore throat for 3 days. Which medium will you use to culture the throat swab?", "options": [{"label": "A", "text": "Blood agar", "correct": true}, {"label": "B", "text": "LJ medium", "correct": false}, {"label": "C", "text": "Stewart medium", "correct": false}, {"label": "D", "text": "Chocolate agar", "correct": false}], "correct_answer": "A. Blood agar", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Blood agar The throat swab should be incubated for 18 to 24 hours on a sheep blood agar plate. Agar plates that are negative at 24 hours should be reexamined at 48 hours. Rapid antigen detection tests have been developed because of this 24- to 48-hour delay before a throat swab can inform clinical management. It is useful for cultivating organisms and for determining the hemolytic capabilities of an organism.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Lowenstein-Jensen (LJ) is the selective medium that is used for the cultivation and isolation of Mycobacterium species. Option C. Growth in Stewart's medium is a simple, rapid, and inexpensive screening tool for the identification of the Burkholderia cepacia complex. Option D. Chocolate agar (CHOC) or chocolate blood agar (CBA), is a nonselective, enriched growth medium used for isolation of pathogenic bacteria. It is not a preferred media for throat swabs because hemolysis cant be appreciated on this agar. Nutrient agar Nutrient broth, agar 2% Routine culture MacConkey medium Peptone, lactose, sodium taurocholate, agar, neutral red Culture of Gram- negative bacteria, such as Escherichia coli Blood agar Nutrient agar, 5% sheep or human blood Routine culture, culture of fastidious organisms, such as Streptococcus spp. Chocolate agar Heated blood agar Culture of Haemophilus influenzae and Neisseria Deoxycholate citrate agar Nutrient agar, sodium deoxycholate, sodium citrate, lactose, neutral red, etc. Culture of Shigella spp. and Salmonella spp. Thiosulfate citrate bile salt sucrose agar Thiosulfate, citrate, bile salt, sucrose, bromothymol blue, thymol blue Culture of Vibrio cholerae Loeffler's serum slope Nutrient broth, glucose, horse serum Culture of Corynebacterium diphtheriae Lowenstein- Jensen medium Coagulated hen's egg, mineral salt solution, asparagine, malachite green Culture of Mycobacterium tuberculosis Options B, C, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A child presents with pustule showing gram-positive cocci, beta-hemolytic, and catalase negative. To show it is group A Streptococcus, which of the following test should be done-", "options": [{"label": "A", "text": "Bacitracin sensitivity", "correct": true}, {"label": "B", "text": "Optochin sensitivity", "correct": false}, {"label": "C", "text": "Novobiocin sensitivity", "correct": false}, {"label": "D", "text": "Bile solubility", "correct": false}], "correct_answer": "A. Bacitracin sensitivity", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bacitracin sensitivity The bacitracin susceptibility test is used to distinguish Group A streptococci, from other streptococci. When grown on blood agar, Group A streptococci are sensitive to (killed by) the antibiotic bacitracin. Streptococcus pyogenes can be differentiated from other non-group A β-hemolytic streptococci by their increased sensitivity to bacitracin. Strep agalactiae is resistant to bacitracin. The bacitracin test, along with the Lancefield antigen A test, is used for greater specificity in the identification of Pyogenes. Any zone of inhibition is considered sensitive.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. It is useful in the identification of Streptococcus pneumoniae, the alpha-hemolytic Streptococcus is susceptible to this Optochin (Zone >14mm). Option C. Clinically, novobiocin is used to separate novobiocin-resistant Staphylococcus saprophyticus, a common urinary tract pathogen, from novobiocin-sensitive skin flora such as Staphylococcus aureus and Staphylococcus epidermidis. IT IS A diagnostic disk. Option D. Bile solubility is not used here, it is used for pneumococcus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In a school child had an abscess on the lower leg. The swab taken revealed gram-positive beta-hemolytic streptococci, and these were bacitracin sensitive. The school physicians observed that a similar organism was isolated from the throats of many other children. Which of the following is a true statement about this patient?", "options": [{"label": "A", "text": "Differences in surface protein can differentiate the pathogenic bacteria from the pharyngeal culture bacteria.", "correct": false}, {"label": "B", "text": "Component C carbohydrate can differentiate the pathogenic bacteria from the throat commensal bacteria.", "correct": false}, {"label": "C", "text": "Mec A gene positive are throat culture streptococci.", "correct": false}, {"label": "D", "text": "Depending on the M protein the cutaneous pathogenic bacteria can be differentiated from the pharyngeal culture bacteria.", "correct": true}], "correct_answer": "D. Depending on the M protein the cutaneous pathogenic bacteria can be differentiated from the pharyngeal culture bacteria.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Depending on the M protein the cutaneous pathogenic bacteria can be differentiated from the pharyngeal culture bacteria. Streptococci are gram-positive aerobic organisms that cause many disorders, including pharyngitis, pneumonia, wound and skin infections, sepsis, and endocarditis. Symptoms vary with the organ infected. Sequelae of infections due to group A beta-hemolytic streptococci may include rheumatic fever and glomerulonephritis. The beta-hemolytic streptococci include the pathogens of Lancefield groups A, B, C, and G. M protein is an important virulence factor expressed on the surface of S. pyogenes and plays multiple roles in streptococcal infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Streptococcus pyogenes, or Group A streptococcus (GAS), is a facultative, Gram-positive coccus that grows in chains and causes numerous infections in humans including pharyngitis, tonsillitis, scarlet fever, cellulitis, erysipelas, rheumatic fever, post-streptococcal glomerulonephritis, necrotizing fasciitis, All are true about streptococcal infections except :", "options": [{"label": "A", "text": "Pharyngitis with strep throat can be confused with infectious mononucleosis.", "correct": false}, {"label": "B", "text": "Mastoiditis is a complication of strep throat.", "correct": false}, {"label": "C", "text": "20% of infections are asymptomatic.", "correct": false}, {"label": "D", "text": "Scarlet fever is more common nowadays", "correct": true}], "correct_answer": "D. Scarlet fever is more common nowadays", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Scarlet fever is more common nowadays Streptococcal sore throat—The most common infection caused by β-hemolytic S. pyogenes is streptococcal sore throat or pharyngitis.</p>\n<p><strong>Highyeild:</strong></p><p>Bacteria attach to the pharyngeal epithelium (l ipoteichoic acid-covered surface pili and hyaluronic acid in encapsulated strains) . In infants and small children, the sore throat occurs as s ubacute nasopharyngitis with a thin serous discharge and fever. infection can extend to the middle ear and the mastoid. The cervical lymph nodes are usually enlarged. The illness may linger on for weeks. In older children and adults, the disease is more acute and is characterized by intense nasopharyngitis, tonsillitis, and intense redness (Bright red throat) and edema of the mucous membranes, with purulent exudate; enlarged, tender cervical lymph nodes; and (usually) a high fever. Twenty percent of infections are asymptomatic. A similar picture can be seen with infectious mononucleosis, diphtheria, gonococcal infection, and adenovirus infection. With the advent of antibiotics, scarlet fever is seen rarely these days.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C, and C. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An 8 yr old boy develops a severe sore throat. On examination, a grayish-white exudate is seen on the tonsils and pharynx. The differential diagnosis includes group A streptococcus infection, EBV infection, diphtheria, and severe adenovirus infection. (Neisseria gonorrhoeae pharyngitis would also be included but the patient has not been sexually abused.) The cause of the pharyngitis is most likely:", "options": [{"label": "A", "text": "Catalase-negative gram-positive coccus that grows in chains.", "correct": true}, {"label": "B", "text": "A single-stranded positive-sense RNA virus", "correct": false}, {"label": "C", "text": "A catalase-positive gram-positive coccus that grows in clusters", "correct": false}, {"label": "D", "text": "A double-stranded RNA virus.", "correct": false}], "correct_answer": "A. Catalase-negative gram-positive coccus that grows in chains.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Catalase-negative gram-positive coccus that grows in chains. Streptococcus (catalase-negative), which grows in chains. The staphylococci further subdivide into coagulase-positive (S. aureus) and coagulase-negative. Group A streptococci are bacteria commonly found in the throat and on the skin. The vast majority of GAS infections are relatively mild illnesses, such as strep throat and impetigo. Group A strep pharyngitis can occur in people of all ages. It is most common among children 5 through 15 years of age. It is rare in children younger than 3 years of age.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Rhinovirus, hep A, and human enterovirus are usually not associated with grey-white throat exudate. Option C. Staph aureus is usually a secondary cause of pharyngitis post-primary viral infection. Option D. Rotavirus and reovirus are not associated with pharyngitis. Option D, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Streptolysin O is closely related to all except-", "options": [{"label": "A", "text": "Pneumolysin", "correct": false}, {"label": "B", "text": "Listeriolysin", "correct": false}, {"label": "C", "text": "Alpha Hemolysin", "correct": true}, {"label": "D", "text": "Tetanolysin", "correct": false}], "correct_answer": "C. Alpha Hemolysin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Alpha Hemolysin Streptolysin-O (SL-O) Streptolysin-S (SL-S) Oxygen labile (hence named streptolysin-O) Heat Labile Oxygen stable Serum soluble (hence named streptolysin-S) Hemolysis is seen only in deep colonies (pour plate) as it is inactivated in the presence of oxygen Causes hemolysis on the surface of blood agar plate It is cytotoxic for neutrophils, platelets and cardiac tissue It has leucocidal activity Strongly antigenic Not antigenic Antistreptolysin-O antibodies (ASO) are raised in most of the streptococcal infections and are used as a standard marker for retrospective diagnosis of streptococcal infections (except in glomerulonephritis and pyoderma; where ASO titer is low) Not useful for serological diagnosis of streptococcal infections Streptolysin-O' Is functionally similar to: structurally and • Tetanolysin of Clostridium tetani • Pneumolysin of S. pneumoniae • Theta toxin of Clostridium perfringens • Listeriolysin O of Listeria Cereolysin of Bacillus cereus</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old boy presents with acute onset of sore throat, fever of 38.9 degrees C, and painful anterior cervical lymphadenopathy. On exam the pharynx is red and swollen and the tonsils are covered with yellow-white exudate. The child also has halitosis. Which of the following non-suppurative complications is of concern?", "options": [{"label": "A", "text": "Sinusitis", "correct": false}, {"label": "B", "text": "Acute rheumatic fever alone", "correct": false}, {"label": "C", "text": "Acute glomerulonephritis alone", "correct": false}, {"label": "D", "text": "Acute rheumatic fever and acute glomerulonephritis", "correct": true}], "correct_answer": "D. Acute rheumatic fever and acute glomerulonephritis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Acute rheumatic fever and acute glomerulonephritis Group A streptococcus can cause both acute glomerulonephritis and acute rheumatic fever due to the immune-mediated effects of the bacteria. The occurrence of characteristic acute post-streptococcal glomerulonephritis and acute rheumatic fever in the same patient is rare. Acute rheumatic fever is a nonsuppurative, delayed sequela of pharyngitis due to S. pyogenes.</p>\n<p><strong>Highyeild:</strong></p><p>Acute glomerulonephritis— develops 1–5 weeks after S. pyogenes skin infection (pyoderma, impetigo) or pharyngitis. Mostly with M types 2,42, 49, 56, 57, and 60. Initiated by antigen-antibody complexes on the glomerular basement membrane. In acute nephritis, the patient has blood and protein in the urine, edema, high blood pressure, and poor renal functions; serum complement levels are also low. Rheumatic fever —This is the most serious sequela of S. pyogenes because it results in damage to heart muscle and valves . Certain strains of group A streptococci contain cell membrane antigens that cross-react with human heart tissue antigens . Sera from patients with rheumatic fever contain antibodies to these antigens.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Sinusitis - is a suppurative complication. Option B. Acute rheumatic fever alone - not the correct option. Option C. Acute glomerulonephritis alone- not the correct option. Options A, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Most common agents responsible for human bite infections are:", "options": [{"label": "A", "text": "Gram-ve bacilli", "correct": false}, {"label": "B", "text": "Gram +ve bacilli", "correct": false}, {"label": "C", "text": "Spirochaete", "correct": false}, {"label": "D", "text": "Anaerobic streptococci", "correct": true}], "correct_answer": "D. Anaerobic streptococci", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Anaerobic streptococci Human bite injuries are also at risk for deep soft tissue infection, tendonitis, septic arthritis, and osteomyelitis. Anaerobic bacteria occur naturally and are the most common flora in the body. In their natural state, they don't cause infection. But they can cause infections after an injury or trauma to the body.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A newborn has a temperature of 39.4°C (103°F). Blood culture grows gram-positive cocci in chains with beta hemolysis. This is most likely to be which of the following?", "options": [{"label": "A", "text": "Group A Streptococci (Streptococcus pyogenes)", "correct": false}, {"label": "B", "text": "Group B Streptococci (Streptococcus agalactiae)", "correct": true}, {"label": "C", "text": "Salmonella species", "correct": false}, {"label": "D", "text": "Streptococcus pneumoniae", "correct": false}], "correct_answer": "B. Group B Streptococci (Streptococcus agalactiae)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Group B Streptococci (Streptococcus agalactiae) Streptococcus agalactiae is a gram-positive coccus with a tendency to form chains. It is a beta-hemolytic, catalase-negative, and facultative anaerobe. S. agalactiae is the species designation for the only species of streptococci belonging to group B of the Rebecca Lancefield classification of streptococci. S agalactiae is best known as a cause of postpartum infection and as the most common cause of neonatal sepsis. Screening of pregnant women is done at 35–37 weeks of pregnancy by a high vaginal swab as it is usually colonized at the vaginal area. Group B streptococci are part of the normal vaginal flora and lower gastrointestinal tract in 5–30% of women. but is associated with severe neonatal morbidity and mortality. It’s treated with peripartum penicillin.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C and D. Do not occur in chains. Option A. Alpha hemolysis is present and not beta hemolysin.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "CAMP test is used for the diagnosis of:", "options": [{"label": "A", "text": "Group B streptococci", "correct": true}, {"label": "B", "text": "Strep. Fecalis", "correct": false}, {"label": "C", "text": "Strep. Pyogenes", "correct": false}, {"label": "D", "text": "Strep. viridans", "correct": false}], "correct_answer": "A. Group B streptococci", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Group B streptococci Camp Test-Christie, Atkins, Munch-Peterson test : Production of CAMP factor by the group B streptococcus results in synergistic hemolysis with the β- lysin of S. aureu s on sheep blood agar plate. Group B streptococcus is CAMP positive, Bacitracin resistant, and hippurate hydrolysis positive.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following procedures are most likely to reduce the incidence of group B streptococcal disease in an infant, except?", "options": [{"label": "A", "text": "Identification of possible high-risk births", "correct": false}, {"label": "B", "text": "Intrapartum antibiotic treatment", "correct": false}, {"label": "C", "text": "Screening of pregnant females at the first office visit, usually during the first trimester", "correct": true}, {"label": "D", "text": "Screening of pregnant females in the last trimester", "correct": false}], "correct_answer": "C. Screening of pregnant females at the first office visit, usually during the first trimester", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Screening of pregnant females at the first office visit, usually during the first trimester Early antibiotic prophylaxis compared with monitoring and selective antibiotic treatment: Routine early prophylaxis with penicillin is no more effective than monitoring and selective antibiotic treatment at reducing the incidence of early-onset group B streptococcal infections in low-birthweight infants and preterm. Adequate maternal diagnosis and prophylactic treatment are necessary to reduce the neonatal morbidity and mortality associated.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Identification of possible high-risk births - can help reduce the incidence of group B streptococcus. Option B. Intrapartum antibiotic treatment - can help reduce the incidence of group B streptococcus. Option D. Screening of pregnant females in the last trimester - can help reduce the incidence of group B streptococcus. Options A, B, and D. Can help reduce the incidence of group B streptococcus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A nonhemolytic bacteria resistant to vancomycin shows growth in 6.5% NaCl, bile resistant. It is likely to be:", "options": [{"label": "A", "text": "Strep. Agalactiae", "correct": false}, {"label": "B", "text": "Strep. Pneumoniae", "correct": false}, {"label": "C", "text": "Enterococcus", "correct": true}, {"label": "D", "text": "Strep. Bovis", "correct": false}], "correct_answer": "C. Enterococcus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterococcus Enterococci can be alpha, beta, or gamma hemolytic. Resistance to vancomycin is on the rise. Gram stain— elongated Gram-positive cocci (‘cigar-shaped/ovoid’), often in pairs and short chains. Culture— facultative anaerobes that can grow at 6.5% NaCl, pH 9.6, and temperatures of 10– 45°C. Biochemical tests— enterococci hydrolyze aesculin and l- pyrrolidinyl- β- naphthylamide (PYR). Can agglutinate with group D in streptococcal grouping kits.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is the primary virulence factor of Streptococcus pneumoniae?", "options": [{"label": "A", "text": "Bile solubility", "correct": false}, {"label": "B", "text": "Optochin production", "correct": false}, {"label": "C", "text": "Polypeptide capsule", "correct": false}, {"label": "D", "text": "Polysaccharide capsule", "correct": true}], "correct_answer": "D. Polysaccharide capsule", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Polysaccharide capsule</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Bile solubility is a diagnostic feature of pneumococcus. Option B. Optochin is used as a diagnostic disk for the detection f this bacteria. Option C. Polypeptide capsule is seen in Hemophilus spp.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is true regarding meningitis with Streptococcus pneumoniae?", "options": [{"label": "A", "text": "Cephalosporins are always effective.", "correct": false}, {"label": "B", "text": "One desires a concentration of antibiotics in the cerebral spinal fluid 10 times the minimal inhibition concentration.", "correct": true}, {"label": "C", "text": "Penicillin is always effective.", "correct": false}, {"label": "D", "text": "Resistance is not increasing in Streptococcus pneumoniae.", "correct": false}], "correct_answer": "B. One desires a concentration of antibiotics in the cerebral spinal fluid 10 times the minimal inhibition concentration.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>One desires a concentration of antibiotics in the cerebral spinal fluid 10 times the minimal inhibition concentration. Pneumococcal meningitis is caused by Streptococcus pneumoniae bacteria (also called pneumococcus, or S pneumoniae). It is a common cause of bacterial meningitis in adults. It is the second most common cause of meningitis in children older than age 2.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. Increase in Resistance is a concern while treating pneumococcus. Option A and C. Penicillin is the drug of choice for pneumococcal meningitis. But in case of increased MIC, vancomycin is preferred. These bacteria don't always cause meningitis. Options A, C, and D. Are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Most common organisms responsible for post-splenectomy infections include:", "options": [{"label": "A", "text": "Streptococcus pneumoniae & H. influenza", "correct": true}, {"label": "B", "text": "Staphylococci", "correct": false}, {"label": "C", "text": "Pseudomonas", "correct": false}, {"label": "D", "text": "Enterobacteriaceae", "correct": false}], "correct_answer": "A. Streptococcus pneumoniae & H. influenza", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Streptococcus pneumoniae & H. influenza An o verwhelming post-splenectomy infection (OPSI) is a rare but rapidly fatal infection occurring in individuals following removal (or permanent dysfunction) of the spleen. e s plee Overwhelming post-splenectomy infection is usually caused by the encapsulated bacteria Streptococcus pneumoniae, Haemophilus influenzae, and Neisseria meningitidis, and more than half of those infected die. The infections are typically c haracterized by either meningitis or sepsis and are caused by encapsulated organisms including Streptococcus pneumoniae.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Staphylococci - not the correct option as these are non - capsulated - so don’t involve in OPSI. Option C. Pseudomonas - not the correct options as these are non - capsulated - so don’t involve in OPSI. Option D. Enterobacteriaceae- not the correct options as these are non - capsulated - so don’t involve in OPSI. Options B, C, and D. These Are not the correct options as these are non - capsulated - so don’t involve in OPSI.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following Streptococcus pyogenes antigens are cross-reactive except:", "options": [{"label": "A", "text": "Cell wall M protein -- Myocardium", "correct": false}, {"label": "B", "text": "Carbohydrate Ag – Cardiac valves", "correct": false}, {"label": "C", "text": "Hyaluronic acid – Synovial fluid", "correct": false}, {"label": "D", "text": "Cytoplasmic membrane – Endothelium", "correct": true}], "correct_answer": "D. Cytoplasmic membrane – Endothelium", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cytoplasmic membrane – Endothelium Streptococcus is known to cross-react with the human antigen causing antigen-antibody reaction and this is the sequelae disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. Are correctly matched.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 33 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A patient presents with a nail problem as shown in the photograph. Extended treatment with an antifungal agent is recommended for the patient. Which of the following drugs is most commonly prescribed to treat this condition?", "options": [{"label": "A", "text": "Amphotericin B", "correct": false}, {"label": "B", "text": "Caspofungin", "correct": false}, {"label": "C", "text": "Flucytosine", "correct": false}, {"label": "D", "text": "Terbinafine", "correct": true}], "correct_answer": "D. Terbinafine", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254639052-QTDV071001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Terbinafine This drug, along with itraconazole , has been shown to have higher rates of cure compared to the previous oral antifungal agents used for this condition. Terbinafine is available in oral and topical formulations and is useful for many types of dermatophyte infections . The other drugs listed are generally used for serious, invasive fungal infections.</p>\n<p><strong>Highyeild:</strong></p><p>Antifungal Drugs Antifungal drugs are used for the treatment of fungal infections (mycoses) that may be superficial or deep infections. Fungal infections are susceptible to the immunocompromised patients due to chemotherapy or antibiotic use. Antifungal drugs can be broadly classified into systemic agent & topical agents. 1. Systemic Agents Antibiotics: Amphotericin B, Griseofulvin Antimetabolites: Flucytosine (5-FC) Azoles: Ketoconazole, Fluconazole, Itraconazole, Vericonazole Allylamine: Terbinafine Echinocandins: Caspofungin, Micafungin, Anidulafungin 2. Topical Agents Polyene Antibiotics: Nystatin, Hamycin, Natamycin Imidazole: Clotrimazole, Miconazole, Econazole Miscellaneous: Tolnaftate, Undecylenic acid, Benzoic acid</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- So, Options A, B, and C. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Fungal diseases that affect people with weakened immune systems An infection caused by Aspergillus, a common mold that lives indoors and outdoors. Candida auris infection. ... Invasive candidiasis. ... Pneumocystis pneumonia (PCP)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old female who recently emigrated with her parents presents with a rather large black macular lesion on the palm of her hand. The parents were not initially concerned until the lesion increased in size to cover about half of the palm. Fearing skin cancer, they decided to have the lesion examined. Skin scrapings treated with 10% KOH revealed the presence of numerous hyphal fragments that were branched and dark in color with elongated budding cells along their length. Which of the following organisms is most likely the cause of the child’s skin lesion?", "options": [{"label": "A", "text": "Hortaea Wernicke", "correct": true}, {"label": "B", "text": "Malassezia furfur", "correct": false}, {"label": "C", "text": "Piedraia hortae", "correct": false}, {"label": "D", "text": "Sporothrix schenckii", "correct": false}], "correct_answer": "A. Hortaea Wernicke", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Hortaea Wernicke The case is descriptive of tinea nigra, a fungal disease caused by H. werneckii and found most commonly in tropical areas. Detection of dark-colored hyphal fragments and arthroconidia in skin scrapings aids in the diagnosis. A . M. furfur causes pityriasis versicolor, a superficial fungal infection that leads to hypopigmented macular lesions on the skin of the arms, trunk, shoulders, face, and/or neck.</p>\n<p><strong>Highyeild:</strong></p><p>Tinea Nigra</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. P. shortage causes black piedra, a fungal infection of hair shafts. Option C. S. schenckii causes a lymphocutaneous mycosis following traumatic inoculation of the skin with fungi present on plant thorns. Trichophyton spp. belong to a group of fungi collectively called the dermatophytes that are responsible for the development of various cutaneous fungal infections including athlete’s foot and jock itch. So, Options B, C, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>The most common types of ringworm include the following: Athlete's foot (tinea pedis). This common condition mostly affects teen and adult males. Jock itch (tinea cruris). Ringworm may be hard to cure. Scalp ringworm (tinea capitis). Nail infection (tinea unguium). Body ringworm (tinea corporis).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old male patient presented with multiple hypopigmented patches over the interscapular region as shown in the image below. These lesions show golden yellow fluorescence under wood lamp examination & an examination of skin scrapings with 10% KOH under the microscope spaghetti and meatball appearance is seen. Which of the following is a diagnosis of the patient's condition?", "options": [{"label": "A", "text": "Pityriasis versicolor", "correct": true}, {"label": "B", "text": "Tinea corporis", "correct": false}, {"label": "C", "text": "White piedra", "correct": false}, {"label": "D", "text": "Dermatophytosis", "correct": false}], "correct_answer": "A. Pityriasis versicolor", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254639431-QTDV071004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pityriasis versicolor The clinical image shows multiple hypopigmented patches over the interscapular region caused by tenia versicolor or pityriasis versicular</p>\n<p><strong>Highyeild:</strong></p><p>These lesions usually show golden yellow fluorescence under wood lamp examination. Examination of skin scrapings with 10% KOH under a microscope spaghetti and meatball appearance is seen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. White Piedra presents as nodules of hair shaft & is caused by Trichosporon beijili Option B. Tinea corporis is a dermatophytosis infection of the body & trunk commonly presents as annular lesions with central clearing. Option D. Dermatophytosis is the group of infections that infect skin, hair & nails caused by Trichosporon, Epidermophyton & Microsporum species. Skin lesions present as annular lesions with central clearing.</p>\n<p><strong>Extraedge:</strong></p><p>Pityriasis versicolor is caused by an overgrowth of yeast on the skin. It most often affects teens and young adults. The condition isn't contagious. Symptoms include patches of skin that are lighter or darker than the surrounding skin, often on the torso and shoulders. Treatments such as anti-fungal creams, lotions or shampoos are usually effective. However, skin discolouration may last for weeks to months.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following statements are true about tinea versicolor? I) Malassezia furfur is the causative organism II) It produces Fried egg colonies on Sabouraud dextrose agar III) On Wood ’s lamp examination it produces golden yellow fluorescence due to pteridine pigment in the cell wall IV) Spaghetti and meatballs appearance is characteristic of Malassezia furfur infection. Select the correct answer from the given below code:", "options": [{"label": "A", "text": "only I", "correct": false}, {"label": "B", "text": "I, II only", "correct": false}, {"label": "C", "text": "I, II, & III", "correct": false}, {"label": "D", "text": "I, II, III, and IV are true", "correct": true}], "correct_answer": "D. I, II, III, and IV are true", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>I, II, III, and IV are true Tinea versicolor and pityriasis versicolor is caused by Malassezia furfur and Malassezia globosa It produces Fried egg colonies on Sabouraud dextrose agar Woods lamp examination it produces golden yellow fluorescence due to pteridine pigment in the cell Wall Spaghetti and meatballs appearance is characteristic of Malassezia furfur infection</p>\n<p><strong>Highyeild:</strong></p><p>Pityriasis versicolor, also known as tinea versicolor, is a common, benign, superficial fungal infection of the skin. Clinical features of pityriasis versicolor include either hyperpigmented or hypopigmented finely scaled macules. The most frequently affected sites are the trunk, neck, and proximal extremities.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options:- All the statements are true about pityriasis versicolor</p>\n<p><strong>Extraedge:</strong></p><p>With treatment, the fungus usually clears up 1–2 weeks. But the skin patches may stay discolored for weeks or months. To make them less noticeable, it's important to use sunscreen to prevent the skin from tanning or burning.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old male patient presented with progressive weakening of hair. On examination, nodules of the hair shaft are observed. The KOH Mount picture is given below. Culture from the specimen produces creamy white colonies and arthrospores are seen along with hyphae. Which of the following is a causative organism of the patient's condition?", "options": [{"label": "A", "text": "Trichosporon beijili", "correct": true}, {"label": "B", "text": "Piedra hortae", "correct": false}, {"label": "C", "text": "Malassezia furfur", "correct": false}, {"label": "D", "text": "Trichophyton rubrum", "correct": false}], "correct_answer": "A. Trichosporon beijili", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254640025-QTDV071006IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichosporon beijili The clinical picture and the image are suggestive of white Piedra which presents as nodules of the hair shaft White Piedra is caused by Trichosporon beijili</p>\n<p><strong>Highyeild:</strong></p><p>Black Versus White Characteristic Black Piedra White Piedra Etiology Piedraia hortac Trichosporon beigelii Nodules Over and around the hair shaft, hard, difficult to detach from the hair On the surface of the hair shaft, softer, easy to separate from hair Direct Examinations Tightly packed dichotomous branched hyphae Arthrospores and blastopores can be seen Presence of asci Positive Negative</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Malassezia fur is a causative agent of tinea versicolor which presents as hyper or hypopigmented patches over the upper body Option B. Piedra Hortae is a causative organism for black Piedra Trichophyton is a dermatophyte infecting skin, nails & hair So, Options B, C, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Epidermophyton floccosum is a filamentous fungus that causes skin and nail infections in humans. This anthropophilic dermatophyte can lead to diseases such as tinea pedis (athlete's foot), tinea cruris, tinea corporis and onychomycosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old male patient presented with progressive weakening of hair. On examination, nodules of the hair shaft are observed. The KOH Mount picture is given below. Culture from the specimen produces Brown color colonies and ascospores are seen along with hyphae. Which of the following is a causative organism of the patient's condition?", "options": [{"label": "A", "text": "Trichosporon beijili", "correct": false}, {"label": "B", "text": "Piedra hortae", "correct": true}, {"label": "C", "text": "Malassezia furfur", "correct": false}, {"label": "D", "text": "Trichophyton rubrum", "correct": false}], "correct_answer": "B. Piedra hortae", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254641587-QTDV071007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Piedra hortae The clinical picture and the image are suggestive of Black Piedra which presents as nodules of the hair shaft Piedra Hortae is a causative organism for black Piedra</p>\n<p><strong>Highyeild:</strong></p><p>Black Versus White Characteristic Black Piedra White Piedra Etiology Piedraia hortac Trichosporon beigelii Nodules Over and around the hair shaft, hard, difficult to detach from the hair On the surface of the hair shaft, softer, easy to separate from hair Direct Examinations Tightly packed dichotomous branched hyphae Arthrospores and blastopores can be seen Presence of asci Positive Negative</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. White Piedra is caused by Trichosporon beijili Option C. Malassezia fur is a causative agent of tinea versicolor which presents as hyper or hypopigmented patches over the upper body Option D. Trichophyton is a dermatophyte infecting skin, nails & hair So, Options A, C, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Piedraia hortae is a dermatophyte and causes a superficial fungal infection known as black piedra, which causes the formation of black nodules on the hair shaft and leads to progressive weakening of the hair. The infection usually infects hairs on the scalp and beard, but other varieties tend to grow on pubic hairs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 50-year-old male farmer by occupation came to OPD with complaints of multiple discharging sinuses on his foot and his foot is Swollen. The patient has a habit of walking barefoot on the farms. Which of the following is not true regarding the patient's condition?", "options": [{"label": "A", "text": "It is caused by actinomycetes and filamentous fungi", "correct": false}, {"label": "B", "text": "Examination of pus in actinomycetoma reveals white-yellow granules called sulfur granules", "correct": false}, {"label": "C", "text": "Eumycetoma reveals filamentous fungi on lactophenol cotton blue staining of SDA culture media", "correct": false}, {"label": "D", "text": "It can affect both upper and lower extremities and is not common in India", "correct": true}], "correct_answer": "D. It can affect both upper and lower extremities and is not common in India", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It can affect both upper and lower extremities and is not common in India Mycetoma is a common condition in India involving the upper and lower extremities characterized by multiple Discharging sinuses It is produced by both filamentous fungi and actinomycete is bacteria</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. It is caused by actinomycetes and filamentous fungi - true Option B. Examination of pus in actinomycetoma reveals white-yellow granules called sulfur granules -true Option C. Eumycetoma reveals filamentous fungi on lactophenol cotton blue staining of SDA culture media - true All the other statements are true regarding mycetoma</p>\n<p><strong>Extraedge:</strong></p><p>Ray fungi belong to the genus Actinomycetes which is a group of bacteria known as actinobacteria. These are gram-positive bacteria with an anaerobic mode of respiration that characterizes them. They are profoundly known as Ray fungi because of their colonies that form a fungus-like branched network of hyphae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old girl was brought in, for evaluation of a single patch of alopecia that had been present on the right side of her scalp for 3 weeks and was mildly pruritic. The patient had been in contact with a cat. The hair pull test was positive. On examination, there is Boggy swelling-like lesion is present on the scalp. On direct examination with KOH, multiple fungal hyphal elements are found. Which of the following is true regarding the diagnosis and causative organism of a patient’s condition?", "options": [{"label": "A", "text": "Kerion-Trichophyton verrucosum", "correct": true}, {"label": "B", "text": "Favus-Trichophyton Schoenleinii", "correct": false}, {"label": "C", "text": "Ectothrix-microsporum canis", "correct": false}, {"label": "D", "text": "Endothrix-trichophyton tonsurans", "correct": false}], "correct_answer": "A. Kerion-Trichophyton verrucosum", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254641857-QTDV071009IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Kerion-Trichophyton verrucosum Kerion is characterized by a boggy swelling lesion on the scalp and the most common organism associated is Trichosporon verrucosum</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Favus is Crust like or Cup lesion sensual of the hair follicles and the most common organism associated is Trichosporon Schoenleinii Option C. Ectothrix is characterized by arthrospores formation on the hair shaft and the most common association is microsponge camis Option D. Endothrix is characterized by arthrospores formation inside hair shod and the most common organism associated is Trichosporon tours</p>\n<p><strong>Extraedge:</strong></p><p>Epidermophyton is a genus of fungus causing superficial and cutaneous mycoses, including E. floccosum, and causes tinea corporis, tinea cruris, tinea pedis, and tinea unguium.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 14-year-old child presented with slightly pruritic scalp lesions that had appeared 2 months earlier. The affected hair is collected by clipping and plucking. The hair clip is mounted on a glass slide and 10% potassium hydroxide is added and a cover slip is applied. After about 1 hour, the specimen is examined under 100x and then at 400x magnification. The view from the binocular microscope is given below. Which of the following is true regarding diagnosis and causative organism of the patient's condition?", "options": [{"label": "A", "text": "Kerion-Trichophyton verrucosum", "correct": false}, {"label": "B", "text": "Favus-Trichophyton Schoenleinii", "correct": false}, {"label": "C", "text": "Ectothrix-microsporum canis", "correct": false}, {"label": "D", "text": "Endothrix-trichophyton tonsurans", "correct": true}], "correct_answer": "D. Endothrix-trichophyton tonsurans", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254642394-QTDV071010IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Endothrix-trichophyton tonsurans Endothrix is characterized by arthrospores formation inside the hair shaft and the most common organism associated is Trichosporon tonsurans.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Kerion is characterized by boggy swelling like lesion on the scalp and the most common organism associated is Trichosporon verrucosum Option C. Ectothrix is characterized by arthrospores formation on the hair shaft and the most common organism associated is Microsporum canis Option B. Favus is Crust like or Cup lesion(scutula)of the hair follicle and the most common organism associated is Trichosporon Schoenleinii So, Options B, C, and A. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton is a genus of fungi, which includes the parasitic varieties that cause tinea, including athlete's foot, ringworm, jock itch, and similar infections of the nail, beard, skin and scalp. Trichophyton fungi are molds characterized by the development of both smooth-walled macro- and microconidia.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 35-year-old child presented to the dermatologist with pruritic scalp lesions. The affected hair is collected by clipping and plucking. The hair clip is mounted on a glass slide and 10% potassium hydroxide is added and a cover slip is applied. After about 1 hour, the specimen is examined under 100x and then at 400x magnification. The view from the binocular microscope is given below. Which of the following is true regarding the diagnosis and causative organism of a patient’s condition?", "options": [{"label": "A", "text": "Kerion-Trichophyton verrucosum", "correct": false}, {"label": "B", "text": "Favus-Trichophyton Schoenleinii", "correct": false}, {"label": "C", "text": "Ectothrix-microsporum canis", "correct": true}, {"label": "D", "text": "Endothrix-trichophyton tonsurans", "correct": false}], "correct_answer": "C. Ectothrix-microsporum canis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254644661-QTDV071011IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Ectothrix-microsporum canis Ectothrix is characterized by arthrospores formation on the hair shaft and the most common organism associated is Microsporum canis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Kerion is characterized by boggy swelling like lesion on the scalp and the most common organism associated is Trichosporon verrucosum Option B. Favus is Crust like or Cup lesion( scutula)of the hair follicle and the most common organism associated is Trichosporon Schoenleinii Option D. Endothrix is characterized by arthrospores formation inside the hair shaft and the most common organism associated is Trichosporon tonsurans So, Options B, A, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton rubrum (T. rubrum) is a dermatophyte responsible for causing the majority of superficial fungal infections worldwide [1]. Dermatophytes are a subset of fungi that have the ability to invade keratinized tissues, such as skin, hair, and nails</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old male athlete presented to the dermatologist with an itching lesion on their foot. Dermatologist provisionally diagnosed the lesion as an athlete's foot or tinea pedis. A skin scraping was taken from the site of the lesion and sent for culture fungus. Fungus culture produces a slow-growing colony with abundant microconidia and pencil-shaped macroconidia as shown in the image below which of the following species of dermatophytes is responsible for the patient's condition?", "options": [{"label": "A", "text": "Trichophyton", "correct": true}, {"label": "B", "text": "Trichosporon", "correct": false}, {"label": "C", "text": "Microsporum", "correct": false}, {"label": "D", "text": "Epidermophyton", "correct": false}], "correct_answer": "A. Trichophyton", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254645138-QTDV071012IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichophyton Trichophyton species affect skin hair and nail It is characterized by abundant microconidia and pencil-shaped long slender macroconidia</p>\n<p><strong>Highyeild:</strong></p><p>Trichophyton rubrum (T. rubrum) is a dermatophyte responsible for causing the majority of superficial fungal infections worldwide [1]. Dermatophytes are a subset of fungi that have the ability to invade keratinized tissues, such as skin, hair, and nails</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Nmicrosporum affects skin and hair but not nails. It is characterized by producing few microconidia and spindle-shaped macroconidia Option D. Epidermophyton species affects skin and nails but not hair. It is characterized by producing club-shaped macroconidia and no microconidia. Option B. Trichosporon species is associated with tinea capitis (white piedra) So, Options B, C, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton rubrum (T. rubrum) is a dermatophyte responsible for causing the majority of superficial fungal infections worldwide [1]. Dermatophytes are a subset of fungi that have the ability to invade keratinized tissues, such as skin, hair, and nails</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 45-year-old male factory worker presented with a history of recurrent tinea cruris for three years. The patient presented with an erythematous patch on the inner aspect of both thighs opposite the scrotum. It spread centrifugally, with partial central clearing and a slightly elevated, erythematous, sharply demarcated border with tiny vesicles that were visible only with a hand glass. The scrotum was spared. The diagnosis was based on a 20% KOH examination of scrapings from the lesion which showed segmented hyphae and arthrospores characteristic of all dermatophyte infections. A skin scraping was taken from the site of the lesion and sent for culture in SDA agar which reveal absent microconidia and club-shaped macroconidia. Which of the following is the causative organism?", "options": [{"label": "A", "text": "Trichophyton", "correct": false}, {"label": "B", "text": "Trichosporon", "correct": false}, {"label": "C", "text": "Microsporum", "correct": false}, {"label": "D", "text": "Epidermophyton", "correct": true}], "correct_answer": "D. Epidermophyton", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254645715-QTDV071014IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Epidermophyton Epidermophyton species affect skin and nails but not hair. It is characterized by producing club-shaped macroconidia and no microconidia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Trichophyton species affects skin hair and nail . It is characterized by abundant microconidia and pencil-shaped long slender macroconidia Option C. Microsporum message skin and hair but not nails. It is characterized by producing few microconidia and spindle-shaped macroconidia Option B. Trichosporon species is associated with tinea capitis (white piedra) Options A, B, and C. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton rubrum (T. rubrum) is a dermatophyte responsible for causing the majority of superficial fungal infections worldwide [1]. Dermatophytes are a subset of fungi that have the ability to invade keratinized tissues, such as skin, hair, and nails.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Tinea versicolor is caused by which of the following?", "options": [{"label": "A", "text": "E. floccosum", "correct": false}, {"label": "B", "text": "H. werneckii", "correct": false}, {"label": "C", "text": "M. furfur", "correct": true}, {"label": "D", "text": "M. canis", "correct": false}], "correct_answer": "C. M. furfur", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>M. furfur Malassezia furfur is a species of fungus that is naturally found on the skin surfaces of humans and some other mammals. It is associated with a variety of dermatological conditions caused by fungal infections, notably seborrhoeic dermatitis, and tinea versicolor. Tinea versicolor is a skin infection with Malassezia furfur that manifests as multiple asymptomatic scaly patches varying in color from white to tan to brown to pink. Diagnosis is based on clinical appearance and potassium hydroxide wet mount of skin scrapings. Treatment is with topical or sometimes oral antifungals.</p>\n<p><strong>Highyeild:</strong></p><p>Tenia Versicolor</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Dermatophyte - Epidermophyton floccosum is a filamentous fungus that causes skin and nail infections in humans. This anthropophilic dermatophyte can lead to diseases such as tinea pedis, tinea cruris, tinea corporis, and onychomycosis . Option B. Werneckii is a species of yeast in the family Teratosphaeriaceae. It is a black yeast that is investigated for its remarkable halotolerant Option D. Microsporum canis is a pathogenic, asexual fungus in the phylum Ascomycota that infects the upper, dead layers of skin on domesticated cats, and occasionally dogs and humans. The species has a worldwide distribution. Options A, B, and D. Are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Tinea is a contagious fungal skin infection. The most commonly affected areas include the feet, groin, scalp and beneath the breasts. Tinea can be spread by skin-to-skin contact or indirectly through towels, clothes or floors. Tinea is also known as ringworm, which is a misleading name as no worm is involved.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Dermatophytes are fungi that require keratin for growth. These fungi can cause superficial infections of the skin, hair, and nails. Which one of the following is a dermatophyte:", "options": [{"label": "A", "text": "Candida albicans", "correct": false}, {"label": "B", "text": "Aspergillus niger", "correct": false}, {"label": "C", "text": "Nocardia asteroides", "correct": false}, {"label": "D", "text": "Trichophyton rubrum", "correct": true}], "correct_answer": "D. Trichophyton rubrum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichophyton rubrum Trichophyton rubrum is a dermatophytic fungus in the phylum Ascomycota. It is an exclusively clonal, anthropophilic saprotroph that colonizes the upper layers of dead skin and i s the most common cause of athlete's foot, fungal infection of nails, jock itch, and ringworm worldwide. Trichophyton is a dermatophytic fungus, which is often responsible for nail, hair follicle, and superficial skin infections. Dermatophytes (particularly Trichophyton rubrum) are responsible for most infections. The clinical presentation varies depending on the modality of the nail invasion. Microconidia and Macroconidia are seen in Dermatophytes, Fusarium</p>\n<p><strong>Highyeild:</strong></p><p>Trichophyton rubrum Infection</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Candida albicans is a yeast-like Option B. Aspergillus - septate molds. Option C. Nocardia - N ocardia is a genus of weakly staining Gram-positive, catalase-positive, rod-shaped bacteria. It forms partially acid-fast beaded branching filaments</p>\n<p><strong>Extraedge:</strong></p><p>T. rubrum colonizes the superficial layers of skin and causes common, but persistent infections such as “athlete's foot”, onychomycosis in the nails, “jock itch” in the groin, and ringworm on any epidermal surface. Often, acute manifestations of T. rubrum may be treated successfully with a topical antifungal.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not a fungal infection-", "options": [{"label": "A", "text": "Blastomycosis", "correct": false}, {"label": "B", "text": "Histoplasmosis", "correct": false}, {"label": "C", "text": "Actinomycosis", "correct": true}, {"label": "D", "text": "Aspergillosis", "correct": false}], "correct_answer": "C. Actinomycosis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Actinomycosis Actinomycosis is a rare, infectious disease in which bacteria spread from one part of the body to another through body tissues. Over time, it can result in linked abscesses, pain, and inflammation. It can affect the skin or deeper areas within the body and sometimes the blood. Actinomycosis is usually caused by the bacterium called Actinomyces israelii . This is a common organism found in the nose. It normally does not cause disease. Because of the bacteria's normal location in the nose and throat, actinomycosis most commonly affects the face and neck.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A and B. By dimorphic fungus. Option D. Septate molds. Options A, B, and D . Are all caused by fungus.</p>\n<p><strong>Extraedge:</strong></p><p>Actinomycosis is a rare subacute to chronic infection caused by the gram-positive filamentous non-acid fast anaerobic to microaerophilic bacteria, Actinomyces. The infection is usually a granulomatous and suppurative infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Opportunistic infections are those that develop mainly in immunocompromised hosts. Primary infections can develop in immunocompetent hosts. Fungal infections can be. Local. Systemic. Which of the following is not an opportunistic fungus-", "options": [{"label": "A", "text": "Cryptococcus neoformans", "correct": false}, {"label": "B", "text": "Aspergillus", "correct": false}, {"label": "C", "text": "Dermatophyte", "correct": true}, {"label": "D", "text": "Candida", "correct": false}], "correct_answer": "C. Dermatophyte", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dermatophyte Dermatophytes are a common label for a group of three types of fungus that commonly causes skin disease in animals and humans. These anamorphic mold genera are Microsporum, Epidermophyton, and Trichophyton. There are about 40 species in these three genera. Opportunistic fungi refer to those fungi that normally would not cause infections in otherwise healthy people but can cause infection under certain circumstances such as immunodeficiency, cancer, organ transplant, neutropenic patients, diabetes, debilitated patients, and patients on long-term antibiotics.</p>\n<p><strong>Highyeild:</strong></p><p>Common opportunistic infections Disease Causative fungus Candidiasis Candida albicans, Candida tropicalis, and other species Aspergillosis Aspergillus fumigates, Aspergillus flavus, Aspergillus niger, and other species Zygomycosis Mucor, Rhizopus, and Absidia species Pneumocystis carinii pneumonia (PCP) Pneumocystis jiroveci Penicilliosis Penicillium marneffei Pseudoallescheria boydii infection Pseudoallescheria boydii Fusarium solani infection Fusarium solani Meningitis Cryptococcus neoformans</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. An infection with the fungus Cryptococcus is known as cryptococcosis, and it is a serious opportunistic infection among people with advanced HIV/AIDS. Option B. Aspergillosis is an opportunistic infection that usually affects the lower respiratory tract and is caused by inhaling spores of the filamentous fungus Aspergillus, commonly present in the environment. Option D. Candida albicans is classified as an opportunistic fungus because it usually only causes disease in those who are immunocompromised or whose natural flora has been altered. Candida species are yeast-type fungi. Options A, B, and D. Are all opportunistic fungi.</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton rubrum is the most common anthropophilic dermatophyte worldwide and its typical infection areas include skin of hands or feet and nail plate. In turn, Microsporum canis is a zoophilic pathogen, and mostly well known for ringworm in pets, it is also known to infect humans.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A nail fungus causing thickened, brittle, crumbly, or ragged nails. Usually, the problems caused by this condition are cosmetic. The main symptoms are changes in the appearance of nails. Rarely, does the condition cause pain or a slightly foul odor? Treatments include oral anti-fungal drugs, medicated nail polish or cream, or nail removal. Nail infection is caused by which fungus:", "options": [{"label": "A", "text": "Dermatophytes", "correct": true}, {"label": "B", "text": "Sporothrix", "correct": false}, {"label": "C", "text": "Rhinosporidium", "correct": false}, {"label": "D", "text": "Histoplasma", "correct": false}], "correct_answer": "A. Dermatophytes", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dermatophytes Dermatophytes are a common label for a group of three types of fungus that commonly causes skin disease in animals and humans. These anamorphic mold genera are Microsporum, Epidermophyton, and Trichophyton . There are about 40 species in these three genera. Dermatophytes are fungi that require keratin for growth. These fungi can cause superficial infections of the skin, hair, and nails. Dermatophytes are spread by direct contact with other people (anthropophilic organisms), animals (zoophilic organisms), and soil (geophilic organisms), as well as indirectly from fomites. Fungal nail infections, Onychomycosis, Tinea unguium, Tinea of the nail, Ringworm of the nail, Candidal onychia, and Dermatophytosis of the nail.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Causes Sporotrichosis (also known as “rose gardener's disease”) Option C. Aquatic protozoan - causes rhinosporidiosis Option D. Dimorphic fungus - causes histoplasmosis</p>\n<p><strong>Extraedge:</strong></p><p>Trichophyton rubrum is the most common anthropophilic dermatophyte worldwide and its typical infection areas include skin of hands or feet and nail plate. In turn, Microsporum canis is a zoophilic pathogen, and mostly well known for ringworm in pets, it is also known to infect humans.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Favus or tinea favors is a severe and chronic inflammatory dermatophyte infection. Historically, the term 'favus' had been used, at the beginning of the nineteenth century, to characterize the honey-like exudate in some scalp infections. Favus is caused by?", "options": [{"label": "A", "text": "Blockage of the sebaceous duct", "correct": false}, {"label": "B", "text": "Staph aureus", "correct": false}, {"label": "C", "text": "Trichophyton schoenleinii", "correct": true}, {"label": "D", "text": "Trichophyton concentric", "correct": false}], "correct_answer": "C. Trichophyton schoenleinii", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichophyton schoenleinii</p>\n<p><strong>Extraedge:</strong></p><p>Epidermophyton is a genus of fungus causing superficial and cutaneous mycoses, including E. floccosum, and causes tinea corporis (ringworm), tinea cruris (jock itch), tinea pedis (athlete's foot), and tinea unguium (fungal infection of the nail bed)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old presented to the clinic with scaly patches on the scalp. Primary smears and culture of the skin and hair were negative. A few weeks later. She returned and was found to have inflammatory lesions. The hair fluoresced under Wood’s light and primary smears of skin and hair contained septate hyphae. On speaking with the parent, it was discovered that there were several pets in the household. Which of the following is the most likely agent?", "options": [{"label": "A", "text": "Epidermophyton floccosum", "correct": false}, {"label": "B", "text": "Microsporum audouinii", "correct": false}, {"label": "C", "text": "Microsporum canis", "correct": true}, {"label": "D", "text": "Trichophyton rubrum", "correct": false}], "correct_answer": "C. Microsporum canis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Microsporum canis Microsporum canis is a pathogenic, asexual fungus in the phylum Ascomycota that infects the upper, dead layers of skin on domesticated cats , and occasionally dogs and humans. The species has a worldwide distribution. Microsporum canis is among the most common dermatophytes associated with tinea capitis and tinea corporis. Unlike some dermatophyte species, M. canis typically does not cause large epidemics. Humans become infected as a result of direct or indirect contact with infected pets. Microsporum canis is a zoophilic dermatophyte, the causative agent of human and animal dermatophytosis worldwide. M. can is. Microsporum canis is generally regarded as a zoophilic dermatophyte, but it often attacks humans. Most human infections are acquired from animals.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Epidermophyton - it affects skin and nails and not hairs Option B. Not the most appropriate agent because -the scalp is unlikely affected by this. Option D. Affects all skin, hair, and nails.</p>\n<p><strong>Extraedge:</strong></p><p>Epidermophyton is a genus of fungus causing superficial and cutaneous mycoses, including E. floccosum, and causes tinea corporis (ringworm), tinea cruris (jock itch), tinea pedis (athlete's foot), and tinea unguium (fungal infection of the nail bed)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Mycetoma is a disease caused by certain types of bacteria and fungi found in soil and water. These bacteria and fungi may enter the body through a break in the skin, often on a person's foot. The most common cause of mycetoma in India is-", "options": [{"label": "A", "text": "Nocardia brasiliensis", "correct": false}, {"label": "B", "text": "Madurella mycetomatis", "correct": false}, {"label": "C", "text": "Actinomadura madurae", "correct": true}, {"label": "D", "text": "Madurella grisea", "correct": false}], "correct_answer": "C. Actinomadura madurae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Actinomadura madurae Actinomadura madurae, Actinomadura Pelletier, and Actinomadura dassonvillei are the species included in the genus Actinomadura. .Actinomadura madurae is an aerobic actinomycete that is best known worldwide as the cause of actinomycotic mycetomas In India, Madurai is a major cause of actinomycotic mycetoma responsible for 31% of recorded cases. Although Madurella mycetomdtis is responsible for most of the cases of mycetoma encountered in the dry, arid regions of the North, the disease is caused predominantly by A. madurae in the Southern region'\". The common organism causing mycetoma in the Indian scenario is Actinomadura madurae.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. Madurella grisea is a fungal species of the genus Madurella. Along with Exophiala jeanselmei, Madurella grisea is one of the most common pathogenic agents associated with eumycetoma. Option B. Madurella mycetomatis is a fungus primarily reported in Central Africa as a cause of mycetoma in humans. It has been misclassified for many years, but with the improvement of molecular techniques, its phylogenetic classification has been established. Option A. Nocardia brasiliensis is a species of Nocardia. As with most members of Actinomycetota, they contain high guanine and cytosine content. It can cause nocardiosis. Options A, B, and D. Are not the most common causes.</p>\n<p><strong>Extraedge:</strong></p><p>Actinomyces is a genus of the Actinomycetia class of bacteria. They all are gram-positive. Actinomyces species are facultatively anaerobic and they grow best under anaerobic conditions</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient presented with swelling in his right foot with multiple discharging sinuses. The lesion did not respond to antibiotics. The likely etiological agent would be:", "options": [{"label": "A", "text": "Actinomadura", "correct": false}, {"label": "B", "text": "Nocardia", "correct": false}, {"label": "C", "text": "Sporothrix", "correct": false}, {"label": "D", "text": "Madurella mycetoma", "correct": true}], "correct_answer": "D. Madurella mycetoma", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Madurella mycetoma Madurella mycetomatis is a fungus primarily reported in Central Africa as a cause of mycetoma in humans. Madurella mycetomatis is the most common cause of eumycotic mycetoma worldwide, causing disease predominantly in South America, Africa, and India. Mycetoma is an uncommon chronic granulomatous infection of cutaneous and subcutaneous tissues that can be caused by filamentous bacteria. Actinomycetoma responds to antibiotic therapy, but prolonged treatment is necessary, with a variety of fungi, the most common being Madurella mycetomatis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B and C. Don’t cause mycetoma - Nocardia is a filamentous bacteria - that causes nocardiosis And sporothrix is a dimorphic fungus causing sporotrichosis. Option A. Actinomycetes causes mycetoma but it is a filamentous bacteria - so will respond to antibiotics.</p>\n<p><strong>Extraedge:</strong></p><p>Actinomyces is a genus of the Actinomycetia class of bacteria. They all are gram-positive. Actinomyces species are facultatively anaerobic and they grow best under anaerobic conditions</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In a mycetoma, there are multiple discharging sinuses. The granules in the discharge are called:", "options": [{"label": "A", "text": "Pus cells", "correct": false}, {"label": "B", "text": "Fungal organisms", "correct": false}, {"label": "C", "text": "Inflammatory cells", "correct": false}, {"label": "D", "text": "Sulphur granules", "correct": true}], "correct_answer": "D. Sulphur granules", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Sulphur granules Mycetoma is a chronic infection of the skin and the subcutaneous tissue . • It can sometimes also affect muscles, bones, tendons, and joints. Mycetoma is characterized by nodules and sinus tracts that discharge watery fluid or pus-containing grains. Mycetoma is a disease caused by certain types of bacteria and fungi found in soil and water. These bacteria and fungi may enter the body through a break in the skin, often on the person's foot. Mycetoma is an uncommon chronic granulomatous infective disease of the skin, the dermis. The grains are histologically seen as sulfur granules surrounded. Mycetoma is an uncommon chronic infection of the skin and subcutaneous tissues in tropical areas. Sulfur granule : any of the small yellow bodies found in the pus of actinomycotic abscesses and coOptionsnsisting of clumps of the causative actinomycete.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Pus cells - not the correct options. Option B. Fungal organisms- not the correct options. C. Inflammatory cells- not the correct options. Options A, B, and C. These are not the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Actinomyces is a genus of the Actinomycetia class of bacteria. They all are gram-positive. Actinomyces species are facultatively anaerobic and they grow best under anaerobic conditions</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 32 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 48-year-old male patient with end-stage renal disease due to nephrosclerosis was evaluated for kidney transplantation and was a known case of hypertension and diabetes for ten years, controlled under medication. Transplantation surgery was planned on the patient, and within 5 hours of transplantation, the patient suffered from high-grade fever, general malaise and generalised weakness. The physician concluded that it was a hyperacute rejection in which major histocompatibility complex MHC played an essential role in the rejection. Which of the following do MHC class III genes encode?", "options": [{"label": "A", "text": "Tumor necrosis factor alpha (TNFα)", "correct": true}, {"label": "B", "text": "Beta 2 macroglobulin", "correct": false}, {"label": "C", "text": "Interleukin 2", "correct": false}, {"label": "D", "text": "Interleukin 1", "correct": false}], "correct_answer": "A. Tumor necrosis factor alpha (TNFα)", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tumor necrosis factor alpha (TNFα) MHC-III region codes for tumor necrosis factor-alpha and beta (TNF α& TNFβ) and is involved in an immune response. MHC Genes Of MHC Organized In 3 Classes - Class I MHC genes Glycoproteins expressed on all nucleated cells Major function to present processed Ags to T - Class II MHC genes Glycoproteins expressed on M, B-cells, DCs Major function to present processed Ags to TH Class III MHC genes Products that include secreted proteins that have immune functions. Ex. Complement system, inflammatory molecules</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Beta 2 macroglobulin forms the structural component of HLA human leukocyte antigen complex MHC 1 major histocompatibility complex region. Option C. Interleukin 2 is secreted by CD8 T cells to activate cytotoxic T cells. Option D. Interleukin 1 is secreted by T cells to activate T helper cells.</p>\n<p><strong>Extraedge:</strong></p><p>The function of MHC molecules is to bind peptide fragments derived from pathogens and display them on the cell surface for recognition by the appropriate T cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 55-year-old male underwent kidney transplantation from a 57-year donor for end-stage renal disease. It was a heterotopic kidney transplantation in which the kidney was placed in the right iliac fossa. Which of the following options regarding the role of MHC major histocompatibility complex proteins are true?", "options": [{"label": "A", "text": "Present Antigens for recognition by T cell antigen receptors", "correct": true}, {"label": "B", "text": "To enhance the secretion of cytokines", "correct": false}, {"label": "C", "text": "To mediate immunoglobulin class switching", "correct": false}, {"label": "D", "text": "All the above statements are true", "correct": false}], "correct_answer": "A. Present Antigens for recognition by T cell antigen receptors", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Present Antigens for recognition by T cell antigen receptors</p>\n<p><strong>Highyeild:</strong></p><p>MHC molecules bind to Peptide antigens & present to T-Cells. Thus, these transplantation antigens are responsible for antigen recognition by TCR (T cell receptors)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. To enhance the secretion of cytokines. MHC major histocompatibility complexes are not associated with the enhancement of cytokine secretion. They are associated with antigen recognition. Option C. To mediate immunoglobulin class switching. Immunoglobulin class switching is determined by the constant region of the H chain (CH) mediated by cytokines released by T-cells (IL-4, IL-5, IFN-?, TGF-Beta) Option D. All are true Option B & C. Are not true about MHC</p>\n<p><strong>Extraedge:</strong></p><p>Major histocompatibility complex (MHC) class I and class II proteins play a pivotal role in the adaptive branch of the immune system. Both classes of proteins share the task of presenting peptides on the cell surface for recognition by T cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient underwent renal transplantation two months back and presented with difficulty breathing. X-ray showed bilateral diffuse interstitial pneumonitis. The probable etiologic agent:", "options": [{"label": "A", "text": "CMV", "correct": true}, {"label": "B", "text": "Histoplasma", "correct": false}, {"label": "C", "text": "Candida", "correct": false}, {"label": "D", "text": "Pneumocystis", "correct": false}], "correct_answer": "A. CMV", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>CMV Human cytomegalovirus (HCMV) is an opportunistic pathogen causing disease, mainly in immunocompromised patients or after congenital infection. HCMV respiratory tract infection leads to pneumonitis in the immunocompromised host, which is often associated with a bad clinical course. Among solid organ transplant recipients, CMV pneumonia is most common in lung transplantations, ranging from 15-55% of cases. Typically, this pneumonia develops between days 15-60 post-transplantation and is characterised by fever, cough, and hypoxia.</p>\n<p><strong>Highyeild:</strong></p><p>A member of a group of herpes-type viruses causes CMV pneumonia. Infection with CMV is very common. Most people are exposed to CMV in their lifetime, but typically only those with weakened immune systems become ill from CMV infection. Cytomegalovirus (CMV) pneumonitis is a recognised cause of serious morbidity and mortality in immunocompromised hosts.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Histoplasma capsulatum - Histoplasmosis is an infection caused by a fungus called Histoplasma . The fungus lives in the environment, particularly in soil containing large bird or bat droppings. Option C. Candidiasis is an infection caused by yeast (a type of fungus) called Candida. Candida usually lives on the skin and inside the body, such as in the mouth, throat, gut, and vagina, without causing any problems. Candida can cause an infection if conditions change inside the vagina to encourage its growth. Option D. Pneumocystis pneumonia (PCP) is a serious infection caused by the fungus Pneumocystis jirovecii . Most people who get PCP have a medical condition that weakens their immune system, like HIV/AIDS, or take medicines (such as corticosteroids) that lower the body’s ability to fight germs and sickness. Options B, C and D. Are not the most common agent causing this in transplant patients.</p>\n<p><strong>Extraedge:</strong></p><p>Occasionally, CMV can cause mononucleosis or hepatitis (liver problem). People with weakened immune systems who get CMV can have more serious symptoms affecting the eyes, lungs, liver, esophagus, stomach, and intestines. Babies born with CMV can have brain, liver, spleen, lung, and growth problems.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A transplant patient taking high levels of immunosuppressive drugs becomes infected with EBV Epstein–Barr virus and develops a lymphoma. The dosage of immunosuppressive drugs given to the patient is subsequently decreased, and the tumor regresses. Which of the following properties of EBV infection is related to the patient's tumor development?", "options": [{"label": "A", "text": "Immortalization of B cells", "correct": true}, {"label": "B", "text": "Increased white blood cell count", "correct": false}, {"label": "C", "text": "Presence of atypical lymphocytes", "correct": false}, {"label": "D", "text": "Production of heterophile antibodies", "correct": false}], "correct_answer": "A. Immortalization of B cells", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Immortalization of B cells EBV Epstein–Barr virus infection increases a person's risk of getting nasopharyngeal cancer (cancer of the area in the back of the nose) and certain types of fast-growing lymphomas such as Burkitt lymphoma. It may also be linked to Hodgkin lymphoma and some cases of stomach cancer. The ability of EBV Epstein–Barr virus to cause cancer is most clearly indicated by the development of B-cell lymphoproliferation in patients who are deficient in T- cell-mediated immunity.</p>\n<p><strong>Highyeild:</strong></p><p>EBV Epstein–Barr virus infection can increase the risk of developing certain rare cancers. This is because mutations in cells infected with EBV can lead to cancerous changes. Some types of cancer that are associated with EBV include Nasopharyngeal cancers. The ability of the virus to efficiently transform B-cells in culture to immortalise EBV Epstein–Barr virus to cause cancer is most clearly indicated by the development of B-cell immortalisation.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Increased white blood cell count -yes, but this does not aid in growth or tumour development Option C. Presence of atypical lymphocytes - yes, but no relation to tumour development Option D. Production of heterophile antibodies - yes, this property is used in its diagnosis. It forms the basis of the paul bunnel test. Options B, C and D. Are true about EBV - but these are not responsible for tumor growth in a patient infected with EBV.</p>\n<p><strong>Extraedge:</strong></p><p>Epstein-Barr virus, or EBV, is one of the most common human viruses in the world. It spreads primarily through saliva. EBV can cause infectious mononucleosis, also called mono, and other illnesses. Most people will get infected with EBV in their lifetime and will not have any symptoms.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following infection is seen most commonly 1-4 months after renal transplantation:", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": true}, {"label": "B", "text": "Chickenpox", "correct": false}, {"label": "C", "text": "Epstein Barr-virus", "correct": false}, {"label": "D", "text": "Coxsackie virus", "correct": false}], "correct_answer": "A. Cytomegalovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cytomegalovirus Cytomegalovirus is a genus of viruses in the order Herpes Virales, in the family Herpesviridae, in the subfamily Betaherpesvirinae. Humans and monkeys serve as natural hosts. The eight species in this genus include the type species, Human beta herpesvirus 5, which is the species that infects humans.</p>\n<p><strong>Highyeild:</strong></p><p>CMV is spread from an infected person through direct contact with saliva or urine, especially from babies and young children through sexual contact. Cytomegalovirus infection is a common herpesvirus infection with a wide range of symptoms: from no symptoms to fever and fatigue (resembling infectious mononucleosis) to severe symptoms involving the eyes, brain, or other internal organs. This virus is spread through sexual and nonsexual contact with body secretions. Cytomegalovirus infection is one of the main infectious morbidities after renal transplant, leading to direct effects, such as disease characterised by viral syndrome or invasive disease, and indirect effects, such as the increased risk of acute rejection and chronic graft dysfunction.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Not most common - Primary varicella infection/chickenpox remains a potentially fatal infection in adult renal transplant recipients. It may present complications ranging from allograft rejections hepatitis, pancreatitis, pneumonia and death. Option C. Not most common - EBV-negative PTLD typically occurs about 7 to 10 years after transplantation. Because of improved survival of transplant patients, the proportion of late and EBV-negative PTLD increases. The pathogenesis needs to be better understood. These lymphomas may be coincidental, as seen in the non-transplanted population. Option D. Coxsackie virus — belongs to a group of viruses called enteroviruses. Coxsackievirus infections often occur in young children, usually during summer and fall.</p>\n<p><strong>Extraedge:</strong></p><p>For EBV we have a six-stage model of infection (naive Blast, GC, memory, Immediate early lytic, Early lytic and Late lytic) where each stage may or may not be regulated by the immune response.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 15 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "All of the following are conditions where the Mantoux test can be false negative except:", "options": [{"label": "A", "text": "Sarcoidosis", "correct": false}, {"label": "B", "text": "Malnutrition", "correct": false}, {"label": "C", "text": "Hodgkin lymphoma", "correct": false}, {"label": "D", "text": "Prior vaccination by BCG", "correct": true}], "correct_answer": "D. Prior vaccination by BCG", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Prior vaccination by BCG Shows False Positive result .</p>\n<p><strong>Highyeild:</strong></p><p>Tuberculin/Mantoux Test The tuberculin skin test is performed by intracutaneous injection of purified protein derivative of M. tuberculosis induces a visible and palpable induration that peaks in 48 to 72 hours . A positive tuberculin test signifies T-cell–mediated immunity to mycobacterial antigens but does not differentiate between infection and active disease . Mantoux/Tuberculin test is Type IV Hypersensitivity . True Negative: A person has never been infected with TB. True Positive: The person has developed antibodies against TB. False-negative reactions may occur in the setting of certain viral infections, sarcoidosis, malnutrition, Hodgkin lymphoma, immunosuppression , and (notably) overwhelming active tuberculous disease . False-positive reactions may result from infection by atypical mycobacteria or prior vaccination with BCG (Bacillus Calmette-Guerin) , an attenuated strain of M. bovis that is used as a vaccine in some countries.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Sarcoidosis. Shows False-negative result . Option: B. Malnutrition. Shows False-negative result . Option: C. Hodgkin lymphoma. Shows False-negative result .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which mediator plays an important role in TH1-mediated macrophage activation and killing of bacteria?", "options": [{"label": "A", "text": "TNF", "correct": false}, {"label": "B", "text": "IL 2", "correct": false}, {"label": "C", "text": "IFN-γ", "correct": true}, {"label": "D", "text": "TGF beta", "correct": false}], "correct_answer": "C. IFN-γ", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>IFN-γ TH1-mediated macrophage activation and killing of bacteria: TH1 cells , both in lymph nodes and in the lung, produce IFN-γ . IFN-γ is the critical mediator that enables macrophages to contain the M. tuberculosis infection . First, IFN-γ stimulates maturation of the phagolysosome in infected macrophages , exposing the bacteria to a lethal acidic, oxidizing environment. Second, IFN-γ stimulates the expression of inducible nitric oxide (NO) synthase , which produces NO . NO combines with other oxidants to create reactive nitrogen intermediates, which are important for killing mycobacteria . Third, IFN-γ mobilizes antimicrobial peptides ( defensins ) against the bacteria. Finally, IFN-γ stimulates autophagy , which sequesters and then destroys damaged organelles and intracellular bacteria such as M. tuberculosis. In addition to stimulating macrophages to kill mycobacteria, the Th1 response orchestrates the formation of granulomas and caseous necrosis .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. TNF. Incorrect . Option: B. IL 2. Incorrect . Option: D. TGF beta. Incorrect .</p>\n<p><strong>Extraedge:</strong></p><p>Macrophages activated by IFN-γ differentiate into the “ epithelioid histiocytes ” that aggregate to form granulomas ; some epithelioid cells may fuse to form giant cells .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Ghon complex is", "options": [{"label": "A", "text": "Parenchymal lung lesion", "correct": false}, {"label": "B", "text": "Lymph nodal involvement", "correct": false}, {"label": "C", "text": "Calcified lesion", "correct": false}, {"label": "D", "text": "A and B", "correct": true}], "correct_answer": "D. A and B", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A and B The combination of parenchymal lung lesion and nodal involvement is referred to as the Ghon complex .</p>\n<p><strong>Highyeild:</strong></p><p>Ghon’s complex Typically, the inhaled bacilli implant in the distal airspaces of the lower part of the upper lobe or the upper part of the lower lobe , usually close to the pleura . As sensitization develops, a 1- to 1.5-cm area of gray-white inflammation with consolidation emerges , known as the Ghon focus . In most cases, the center of this focus undergoes caseous necrosis . Tubercle bacilli, free or within phagocytes, drain to the regional nodes, which are often caseate. The combination of parenchymal lung lesion and nodal involvement is referred to as the Ghon complex .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Parenchymal lung lesion. Called Ghon focus . Option: B. Lymph nodal involvement. Incorrect . Option: C. Calcified lesion. Incorrect .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In primary tuberculosis, all of the following can be seen except:", "options": [{"label": "A", "text": "Caseation", "correct": false}, {"label": "B", "text": "Cavitation", "correct": true}, {"label": "C", "text": "Calcification", "correct": false}, {"label": "D", "text": "Langerhans giant cell", "correct": false}], "correct_answer": "B. Cavitation", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Cavitation</p>\n<p><strong>Highyeild:</strong></p><p>Primary tuberculosis is a form of the disease that develops in a previously unexposed and therefore unsensitized person . With primary tuberculosis, the source of the organism is exogenous . In most people, the primary infection is contained, but in others, primary tuberculosis is progressive. In contrast to secondary tuberculosis (an apical disease with cavitation; see later), progressive primary tuberculosis more often resembles acute bacterial pneumonia with the consolidation of the lobe, hilar adenopathy, and pleural effusion. Lymphatic and hematogenous dissemination following primary infection may result in the development of tuberculous meningitis and miliary tuberculosis .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Caseation. Seen in primary TB . Option: C. Calcification. Seen in primary TB . Option: D. Langerhans giant cell. Seen in primary TB .</p>\n<p><strong>Extraedge:</strong></p><p>Secondary pulmonary tuberculosis classically involves the apex of the upper lobes of one or both lungs . Because of the preexistence of hypersensitivity, the bacilli elicit a prompt and marked tissue response that tends to wall off the focus of infection . As a result, the regional lymph nodes are less prominently involved early in secondary disease than they are in primary tuberculosis. On the other hand, cavitation occurs readily in the secondary form . Indeed, cavitation is almost inevitable in neglected secondary tuberculosis , and erosion of the cavities into an airway is an important source of infection because the person now coughs sputum that contains bacteria .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Lung biopsy from a 25-year-old patient who presented with a history of weight loss, evening rise of temperature, raised ESR, and cervical lymphadenopathy. Based on clinical findings and the histological diagram given below, what is your diagnosis?", "options": [{"label": "A", "text": "Hodgkin lymphoma", "correct": false}, {"label": "B", "text": "Tuberculosis", "correct": true}, {"label": "C", "text": "Asthma", "correct": false}, {"label": "D", "text": "Squamous cell carcinoma", "correct": false}], "correct_answer": "B. Tuberculosis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1686826656223-QTDP066006IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Tuberculosis</p>\n<p><strong>Highyeild:</strong></p><p>Histologically , sites of active involvement are marked by a characteristic granulomatous inflammatory reaction that forms both caseating and noncaseating tubercles . Individual tubercles are microscopic; it is only when multiple granulomas coalesce that they become macroscopically visible. The granulomas are usually enclosed within a fibroblastic rim punctuated by lymphocytes . Multinucleated giant cells are present in the granulomas. Immunocompromised people do not form the characteristic granulomas, and their macrophages contain many bacilli</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Hodgkin lymphoma. Hodgkin’s Lymphoma is B cell-derived lymphoma . Reed–Sternberg cells are distinctive, giant cells found with light microscopy in biopsies from individuals with Hodgkin lymphoma. Option: C. Asthma is a reversible bronchospasm, Type I Hypersensitivity, microscopy shows Curshman spirals, Creola bodies, and Charcot Leyden crystals ( made up of Galactin 10) . Option: D. Squamous cell carcinoma. Squamous Cell Carcinoma microscopically shows Dysplastic squamous epithelium, Tumor nests in subepithelium, and Keratin pearls .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following statements are true regarding mycobacterium avium complex except:", "options": [{"label": "A", "text": "Infection is seen predominantly in immunocompromised patients", "correct": false}, {"label": "B", "text": "Hallmark of disease is macrophages laden with acid-fast bacilli", "correct": false}, {"label": "C", "text": "Grossly, the involved organ shows yellow pigmentation", "correct": false}, {"label": "D", "text": "Numerous granuloma formation is always seen", "correct": true}], "correct_answer": "D. Numerous granuloma formation is always seen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Numerous granuloma formation is always seen</p>\n<p><strong>Highyeild:</strong></p><p>Mycobacterium avium complex (MAC): Clinically significant infection with Mycobacterium avium complex (MAC) is uncommon except among people with T-cell immunodeficiency due to AIDS , and immunosuppression resulting from treatment for transplant rejection or autoimmune diseases . Normal host defense mechanisms usually prevent infection, so vulnerable individuals include those with structural lung damage, cystic fibrosis, bronchiectasis, primary ciliary dyskinesia, chronic obstructive pulmonary disease, or pneumoconiosis . The hallmark of MAC infections in patients with HIV is abundant acid-fast bacilli within macrophages. Depending on the severity of immunodeficiency , MAC infections can be widely disseminated throughout the mononuclear phagocyte system , causing enlargement of involved lymph nodes, liver, and spleen , or localized to the lungs. There may be a yellowish pigmentation to these organs secondary to a large number of organisms present in swollen macrophages . Granulomas, lymphocytes, and tissue destruction are RARE . Mycobacterium avium infection in a patient with AIDS, showing massive infection with acid-fast organisms. This pattern is more common in patients with acquired immunodeficiencies.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Infection is seen predominantly in immunocompromised patients. Correct . Option: B. Hallmark of the disease is macrophages laden with acid-fast bacilli. Correct . Option: C. Grossly, the involved organ shows yellow pigmentation. Correct .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 15-year-old girl was brought by her mother to the emergency department. The patient appeared cachexic and was unconscious. Her mother gave a history of fever with loose stools for 6 days which they managed just with paracetamol and the condition of the patient kept deteriorating. Her last CBC Complete blood count report showed leukopenia. The patient, unfortunately, succumbed to death. On autopsy, splenomegaly was revealed along with longitudinal ulcers observed in the intestine. What could be the possible diagnosis?", "options": [{"label": "A", "text": "Enteric fever", "correct": true}, {"label": "B", "text": "Tuberculosis", "correct": false}, {"label": "C", "text": "Amoebiasis", "correct": false}, {"label": "D", "text": "Hemorrhagic colitis", "correct": false}], "correct_answer": "A. Enteric fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enteric fever The given clinical scenario followed by the autopsy findings of longitudinal ulcers classically is a presentation of typhoid i.e. enteric fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Tuberculosis is associated with transverse ulcers. Option C. Amoebiasis is associated with flask-shaped ulcers. Option D. Hemorrhagic colitis will have a history of extensive blood loss in stools.</p>\n<p><strong>Extraedge:</strong></p><p>Early symptoms include fever, general ill-feeling, and abdominal pain. High fever (103°F, or 39.5°C) or higher and severe diarrhea occur as the disease gets worse. Some people develop a rash called \"rose spots,\" which are small red spots on the abdomen and chest.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 38-year-old man complains of a persistent high fever with chills, malaise, and diffuse abdominal pain for over a week. He recently returned from a trip to India. The fever began slowly and increased to 40.0°C (104.0°F) over the last 4 days. A physical exam reveals a white-coated tongue, enlarged spleen, and rose-coloured spots on the abdomen. A bone marrow aspirate was sent for a culture that revealed motile, gram-negative rods. Which of the following is true about the organism and the pathophysiology underlying this condition?", "options": [{"label": "A", "text": "It forms blue-green colonies with a fruity odour", "correct": false}, {"label": "B", "text": "It survives intracellularly within phagocytes of Peyer's patches", "correct": true}, {"label": "C", "text": "Splenectomy may be necessary for carriers", "correct": false}, {"label": "D", "text": "Incidence increases after cholecystectomy", "correct": false}], "correct_answer": "B. It survives intracellularly within phagocytes of Peyer's patches", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It survives intracellularly within phagocytes of Peyer's patches This patient has typhoid fever (enteric fever), which is caused by Salmonella typhi, a motile gram-negative bacteria with peritrichous flagella. Salmonella has somatic O, capsular Vi, and flagellar H antigens. Typhoid fever presents as a gradual onset of high-grade fever over several days with relative bradycardia (Faget sign). Fever starts low and increases daily in a stepwise pattern. It is associated with generalized weakness, abdominal pain, constipation, and headaches. Some people develop rose-coloured spots on the abdomen. Diarrhoea and vomiting are uncommon. Untreated cases may lead to complications, including haemorrhage, intestinal perforation with resulting septicemia, and/or peritonitis, encephalitis, cholecystitis, and osteitis. Some people may carry the bacterium within their gallbladder without being affected, termed as ‘carriers’; however, they are still able to spread the disease to others. Typhoid fever spreads by the faecal-oral route. Salmonella enters the host's system primarily through the distal ileum (Peyer's patches). The bacteria survive inside macrophages and co-opt the macrophages' cellular machinery for their own reproduction as they are carried through the mesenteric lymph nodes to the reticuloendothelial tissues of the liver, spleen, and bone marrow. Some bacteria infect the gallbladder and come back again to the gut within bile, either to reinfect Peyer's patches or to be shed in faeces to infect other people. The diagnosis of typhoid fever is made by characteristic signs and symptoms along with observing Salmonella typhi in any blood, bone marrow, or stool cultures.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Pseudomonas aeruginosa forms blue-green colonies with a fruity odor. It commonly causes skin and respiratory infections. Option C: Splenectomy increases the incidence of Salmonella infections. Salmonella has a capsule and the spleen is important for clearing the infection. This is the reason Salmonella infections are more common in patients with sickle cell disease who have functional asplenia. Option D: The incidence of typhoid fever decreases after cholecystectomy. Salmonella resides within the gallbladder of carriers and sheds the bacteria within bile only to be passed in the feces and infect others. One of the treatment options for carriers who do not respond to medical treatment is cholecystectomy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following are used in enteric fever except:", "options": [{"label": "A", "text": "Amikacin", "correct": true}, {"label": "B", "text": "Ciprofloxacin", "correct": false}, {"label": "C", "text": "Ceftriaxone", "correct": false}, {"label": "D", "text": "Azithromycin", "correct": false}], "correct_answer": "A. Amikacin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Amikacin Gentamicin and amikacin are aminoglycoside antibacterial agents that are mainly used for the treatment of extracellular pathogen infections, such as Pseudomonas aeruginosa and E. coli infections, and thus are not commonly used for the treatment of typhoid fever. Other options B, C and D are used in enteric fever. Commonly prescribed antibiotics include Ciprofloxacin ( Cipro). Azithromycin -.This may be used if a person is unable to take ciprofloxacin or the bacteria is resistant to ciprofloxacin. Ceftriaxone.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B - Ciprofloxacin is the drug of choice in typhoid fever Option C - Ceftriaxone is in ciprofloxacin resistant infections Option D - Azithromycin is also a commonly used antibiotic in typhoid fever</p>\n<p><strong>Extraedge:</strong></p><p>Rose spots describe the rash that occurs in up to 30% of people infected with Salmonella enterica serovar typhi. Characteristically, rose spots are seen in untreated typhoid fever. Rose spots usually occur between the second and fourth week of illness.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Shown in the Image is motility test agar. Which of the following will show this result", "options": [{"label": "A", "text": "S. Typhi", "correct": false}, {"label": "B", "text": "S. Paratyphi A", "correct": false}, {"label": "C", "text": "S. Paratyphi B", "correct": false}, {"label": "D", "text": "S. Gallinarum-Pullorum", "correct": true}], "correct_answer": "D. S. Gallinarum-Pullorum", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687504559216-QTDV008004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>S. Gallinarum-Pullorum Pullorum and Gallinarum (S. Gallinarum) can result in pullorum disease and fowl typhoid in avian species, respectively, and cause considerable economic losses in poultry in many developing.</p>\n<p><strong>Highyeild:</strong></p><p>Salmonella infections in poultry include Salmonella gallinarum and pullorum, the paratyphoid Salmonella S enteritidis and S typhimurium and S Arizonae. Beta-lactamase producer Gallinarum was confirmed as the cause of the O/F test, and motility test using motility indole urea medium.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B & C. Salmonella serotypes are plated on salmonella-shigella (SS) agar, Hektoen enteric agar, xylose-lysine desoxycholate (XLD) agar, or desoxycholate-citrate agar, which growth of salmonellae and shigellae over there. Chromogenic agar specifically for salmonella recovery ialso available.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "What is the reservoir for Salmonella typhi?", "options": [{"label": "A", "text": "Wild rodents", "correct": false}, {"label": "B", "text": "Soil", "correct": false}, {"label": "C", "text": "Humans", "correct": true}, {"label": "D", "text": "Pigs", "correct": false}], "correct_answer": "C. Humans", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Humans Salmonella Typhi (S. Typhi) are bacteria which infect the intestinal tract and the blood . The disease is referred to as typhoid fever. Paratyphi A, B and C bacteria cause a similar illness which is included under the typhoid heading.</p>\n<p><strong>Highyeild:</strong></p><p>Humans are the only reservoir for Salmonella typhi which is the most serious, whereas Salmonella paratyphi also has animal reservoirs. Humans can carry the bacteria in the gut for very long times (chronic carriers), and transmit the bacteria to other persons either directly or via food or water contamination.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Wild rodents harbour different complex bacteria such as M. tuberculosis, M microti, E.coli and agents of Listeriosis, Lyme disease, Q fever etc Option B . Soil is a common reservoir of C lostridium botulinum Option D. Pigs act as reservoirs of trypanosomes.</p>\n<p><strong>Extraedge:</strong></p><p>Organism Primary habitat Quantitative levels Salmonella spp. Shigella spp. Escherichia coli Intestines of warm blooded animals/humans Levels in symptomatic and asymptomatic carriers vary; levels in seafood assumed to be sporadic and low. May accumulate in molluscan. shellfish Campylobacter jejuni and other Mesophilic campylobacter Birds, intestines of warm blooded animals Sporadic, low levels. Possibly accumulation in molluscan shellfish Staphylococcus aureus Outer surface (skin) and mucus membranes (nose) Transient, but present on 50% of population. Generally <100 cfu/cm² skin</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In a patient with typhoid, diagnosis after 15 days of the onset of fever is best done by:", "options": [{"label": "A", "text": "Blood culture", "correct": false}, {"label": "B", "text": "Widal", "correct": true}, {"label": "C", "text": "Stool culture", "correct": false}, {"label": "D", "text": "Urine culture", "correct": false}], "correct_answer": "B. Widal", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Widal Typhoid fever , also known simply as typhoid, is a bacterial infection due to a specific type of Salmonella that causes symptoms. Typhoid fever is a systemic infection caused by Salmonella Typhi, usually through ingestion of contaminated food or water. Widal test in the diagnosis of typhoid fever. Salmonella enterica serotype Typhi bacteria cause typhoid fever.</p>\n<p><strong>Highyeild:</strong></p><p>Widal test in the diagnosis of typhoid fever. Salmonella enterica serotype typhi bacteria cause typhoid fever. in serum from suspected typhi-infected patients who present with febrile illness. The Widal test is a presumptive serological test for enteric fever. This test measures the titres of antibodies against the bacteria which cause typhoid.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Blood culture is the gold standard for diagnosis of typhoid fever and is best when performed within one week of the onset of symptoms. After the 2nd week, the blood culture positivity rates fall in half of the cases Option C. Stool culture will be positive but is not a reliable test Option D. Urine culture may be done and is positive but is less reliable and less sensitive. It is done on the MacConkey Media</p>\n<p><strong>Extraedge:</strong></p><p>Introduction: The tests measure agglutinating antibodies directed against a Salmonella O somatic surface antigen and/or a Salmonella H flagella antigen of the suspected organism. The Widal test detects antibodies against O and H antigens. Type of techniques is use direct agglutination. Widal test, developed by Fernand Widal in 1896.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In which of the following sites is Salmonella typhi most likely to be found during the carrier state?", "options": [{"label": "A", "text": "Blood", "correct": false}, {"label": "B", "text": "Gallbladder", "correct": true}, {"label": "C", "text": "Kidney", "correct": false}, {"label": "D", "text": "Liver", "correct": false}], "correct_answer": "B. Gallbladder", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gallbladder Up to 10% of untreated patients become carriers . Carriers are of two types: Faecal carriers (more common): Multiply in the gallbladder and are excreted in fa Urinary carriers: Multiplication takes place in kidneys and bacilli are excreted in urine.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C & D – Salmonella typhi is not found in blood, kidney or liver during its carrier state.</p>\n<p><strong>Extraedge:</strong></p><p>With treatment, the symptoms of typhoid fever should quickly improve within 3 to 5 days. If typhoid fever isn't treated, it'll usually get worse over the course of a few weeks, and there's a significant risk of life-threatening complications developing.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 4-year-old has a fever and diarrhoea. Blood culture grows a gram-negative rod. This is most likely to be which of the following?", "options": [{"label": "A", "text": "Group B Streptococcus", "correct": false}, {"label": "B", "text": "Listeria species", "correct": false}, {"label": "C", "text": "Salmonella", "correct": true}, {"label": "D", "text": "Shigella", "correct": false}], "correct_answer": "C. Salmonella", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Salmonella Enterocolitis is the most common manifestation of Salmonella In the United States, S. typhimurium and S. enteritidis are prominent, but enterocolitis may be caused by more than 3000 strains of Salmonella. Bacteraemia is rare (2-4%) except in immunodeficient persons, infants and elderlies. Stool cultures may remain positive for Salmonella weeks after clinical recovery.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A & B. Streptococci and Listeria stain gram-positive. Option D. Shigella organisms rarely, if ever, enter the bloodstream from the intestines. Also, it presents with dysentery</p>\n<p><strong>Extraedge:</strong></p><p>Typhoid fever, also known as typhoid, is a disease caused by Salmonella serotype Typhi bacteria.[2] Symptoms vary from mild to severe, and usually begin six to 30 days after exposure.[3][4] Often there is a gradual onset of a high fever over several days.[3] This is commonly accompanied by weakness, abdominal pain, constipation, headaches, and mild vomiting.[4][5] Some people develop a skin rash with rose colored spots.[4] In severe cases, people may experience confusion.[5] Without treatment, symptoms may last weeks or months.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "For paratyphoid fever, all are true except:", "options": [{"label": "A", "text": "Causes enteric fever", "correct": false}, {"label": "B", "text": "Incubation period 2-3 weeks", "correct": false}, {"label": "C", "text": "Carrier state not seen", "correct": true}, {"label": "D", "text": "Milder disease as compared to typhoid fever", "correct": false}], "correct_answer": "C. Carrier state not seen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Carrier state not seen A carrier state can develop in both typhoid and paratyphoid fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Enteric fever is caused by Salmonella typhi, S. paratyphi A, B and C in decreasing order of frequency. Option B: The incubation period ranges from 3-21 days. Option D: Paratyphoid fever is generally milder as compared to typhoid fever. Carriers-convalescent (up to 3 weeks after clinical cure), temporary (3 months to 1 year) and chronic(more than 1 year), Carriers can be faecal or urinary carriers.</p>\n<p><strong>Extraedge:</strong></p><p>Typhoid is caused by the bacterium Salmonella enterica subsp. enterica serovar Typhi growing in the intestines, peyers patches, mesenteric lymph nodes, spleen, liver, gallbladder, bone marrow and blood.[4][5] Typhoid is spread by eating or drinking food or water contaminated with the feces of an infected person.[6] Risk factors include limited access to clean drinking water and poor sanitation.[2] Those who have not yet been exposed to the pathogen and ingest contaminated drinking water or food are most at risk for developing symptoms.[5] Only humans can be infected; there are no known animal reservoirs.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 19 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 22-year-old woman comes to the emergency department with fevers and arthralgias. She recently had unprotected sex with a new male partner. Her temperature is 38.4 C (101.1 F), blood pressure is 118/76 mm Hg, pulse is 102/min, and respirations are 16/min. Examination shows several pustules on the dorsal aspects of her forearms. Her right wrist and ankle are tender on palpation. Gram-negative bacteria isolated from this patient's blood produce an enzyme that splits the IgA molecule at the hinge region. Which of the following is likely to be the most important role of this bacterial enzyme in the course of the infection?", "options": [{"label": "A", "text": "It facilitates mucosal adherence of bacteria", "correct": true}, {"label": "B", "text": "It impairs complement-mediated cell lysis", "correct": false}, {"label": "C", "text": "It impairs opsonization and phagocytosis", "correct": false}, {"label": "D", "text": "It impairs secondary immune response generation", "correct": false}], "correct_answer": "A. It facilitates mucosal adherence of bacteria", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>It facilitates mucosal adherence of bacteria This patient most likely has disseminated gonorrheal infection (a triad of arthritis, dermatitis, and tenosynovitis in a sexually active woman) due to Neisseria gonorrhoeae. In mucosal regions as well as in secretions, lgA exists in its secretory form, composed of an IgA dimer joined by a peptide J chain) and a peptide secretory component. lgA antibodies usually bind to pili and other membrane proteins involved in bacterial adherence to the mucosa , thus inhibiting mucosal colonization by the microorganism. Certain bacteria (eg, N. gonorrhoeae, N. Meningitidis, Streptococcus pneumoniae, Haemophilus influenzae) produce lgA proteases that cleave lgA at its hinge region (yielding Fab and compromised Fc fragments), thus decreasing its effectiveness. This facilitates bacterial adherence to the mucosa (possibly due to easier bacterial access to the mucosal surface or immune disguise by binding to released Fab fragments, among others).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: IgA is a weak activator of the classic complement pathway. Impairment of complement-mediated cell lysis can be accomplished by staphylococcal protein A, which binds the Fc portion of lgG, preventing complement fixation. Option C: Although lgA Fc-mediated functions such as opsonization are compromised by lgA protease, secretory IgA is a poor opsonin. Impairment of opsonization and phagocytosis is most frequently accomplished by encapsulated bacteria such as S pneumoniae, N meningitidis, and H influenzae. Option D: IgA does not play a role in the induction of memory lymphocytes necessary for mounting a secondary immune response (which requires the formation of memory B and T lymphocytes after initial antigen exposure).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 26-year-old has a fever, malaise, and joint pain. A week ago, the patient had pain in the small joints of her right hand, which improved spontaneously but was quickly followed by pain in the right ankle and left wrist. She has no prior medical problems and takes no medications. Temperature is 38 C (100.4 F), blood pressure is 124/82 mm Hg, and pulse is 90/min. The extremity joints are not erythematous or swollen, but tenderness is present along the tendons of the left wrist and right ankle. Several small, non-tender pustules are seen on the extremities. There is no other rash. Blood culture in a selective growth medium consisting of chocolate agar and multiple antibiotics yields the causative pathogen. Which of the following strategies would most likely have prevented this patient's current condition?", "options": [{"label": "A", "text": "Avoiding bites from ticks", "correct": false}, {"label": "B", "text": "Obtaining adequate vaccinations", "correct": false}, {"label": "C", "text": "Thoroughly cooking meat products", "correct": false}, {"label": "D", "text": "Using condoms consistently", "correct": true}], "correct_answer": "D. Using condoms consistently", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Using condoms consistently This patient most likely has disseminated gonococcal infection due to Neisseria gonorrhoeae.</p>\n<p><strong>Highyeild:</strong></p><p>Disseminated Gonococcal Infection It typically presents with the triad of polyarthralgia, tenosynovitis, and dermatitis {painless pustules on the extremities) or purulent arthritis. The diagnosis is confirmed when the organism is isolated on Thayer-Martin media, chocolate agar infused with antibiotics. N gonorrhoeae is spread primarily via infected genital secretions during sexual contact. Therefore, most cases can be prevented by the consistent use of condoms, which act as a mucosal barrier between sexual partners. Patients with genitourinary N gonorrhoeae infections may have purulent cervicitis or urethritis, but many are asymptomatic. Asymptomatic infection increases the risk of spreading to deeper tissues (eg, disseminated gonococcal infection, pelvic inflammatory disease) because of treatment delay.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A: Lyme disease is a tick-borne illness caused by the spirochete Borrelia burgdorferi. Early localized Lyme disease can be associated with arthralgias, myalgias, fever, and erythema migrans (a migrating, erythematous, bull's-eye rash}. However, it is not associated with tendonitis/pustules, and spirochetes cannot be cultured on Thayer-Martin media. Option B: N gonorrhoeae undergoes a dramatic antigenic variation of its surface molecules, which prevents the formation of protective antibodies against future infection. this phenomenon is associated with repeated infections when exposure occurs. No vaccinations are effective. Only barrier contraception is useful. Option C: The roundworm Trichinella, Tenia spp. can be transmitted via undercooked pork. The culture of these parasites on Thayer-Martin media is not possible. Erythema chronicum migrans: Annualar/ target lesion due to Lyme’s disease.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 25-year-old male who works for daily wages presents to the Medicine OPD with complaints of discharge from his genitals for the past day. He further mentioned that 3 days back he had sexual intercourse with a commercial sex worker. The resident doctor on examination described the discharge as a ‘flow of seed'. What is the suitable medium to culture the discharge material?", "options": [{"label": "A", "text": "Mannitol Salt Agar", "correct": false}, {"label": "B", "text": "Thayer Martin media", "correct": true}, {"label": "C", "text": "Potassium Tellurite Agar", "correct": false}, {"label": "D", "text": "TCBS Thiosulfate-citrate-bile salts-sucrose agar", "correct": false}], "correct_answer": "B. Thayer Martin media", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Thayer Martin media T he given history and the typical description of the genital discharge hint towards an infection with N. Gonorrhea called gonococcal urethritis. The patient sees a thick white discharge and feels like the semen (“seed”) is flowing through his penis. The selective media used for gonococcus is Thayer Martin medium.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Mannitol Salt Agar is selective media for Staphylococcus aureus (yellow-colored colonies). (FIG 1) Option C. Potassium Tellurite Agar is selective media for Corynebacterium diphtheriae (black-grey colored colonies) (FIG 2) Option D. TCBS is selective media for Vibrio cholerae (yellow colonies). (FIG 3)</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Urethritis is an inflammation of the urethra. Typically, urethritis is caused by an infection. Most commonly, but not always, the cause is a sexually transmitted infection. Urethritis in males is NOT caused by:", "options": [{"label": "A", "text": "H. Ducreyi", "correct": true}, {"label": "B", "text": "Trichomonas", "correct": false}, {"label": "C", "text": "Chlamydia", "correct": false}, {"label": "D", "text": "Gonococcus", "correct": false}], "correct_answer": "A. H. Ducreyi", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>H. Ducreyi In men, urethral discharge mainly is caused by gonococcal urethritis , caused by N. gonorrhoeae, nongonococcal urethritis , caused by C. trachomatis (15–55% of cases), Mycoplasma genitalium, Ureaplasma urealyticum (20–40% of cases), and infrequently by Trichomonas vaginalis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A- Haemophilus ducreyi is a fastidious gram-negative coccobacillus bacteria. It causes the sexually transmitted disease chancroid, a major cause of genital ulceration in developing countries characterized by painful sores on the genitalia. Option B - Trichomonas is a cause of nongonococcal urethritis (NGU), its prevalence in men has been hampered by the lack of sensitive diagnostics. DNA deoxyribonucleic acid amplification allows for a reappraisal of the extent of infection in men. Option C - Chlamydial urethritis in men is an infection of the urethra caused by the sexually transmitted disease chlamydia trachomatis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Neisseria gonorrhoeae, also known as gonococcus, or gonococci is a species of Gram-negative diplococci bacteria isolated by Albert Neisser in 1879. All are true about N. gonorrhoeae except:", "options": [{"label": "A", "text": "In adult females ovaries are commonly affected", "correct": true}, {"label": "B", "text": "Thayer martin medium is a selective medium", "correct": false}, {"label": "C", "text": "Produces water can perineum", "correct": false}, {"label": "D", "text": "Pili is an important virulence factor", "correct": false}], "correct_answer": "A. In adult females ovaries are commonly affected", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>In adult females ovaries are commonly affected Neisseria gonorrhoeae belongs to the genus Neisseria within the family Neisseriaceae. It is a Gram-negative, non-spore-forming, non-motile, encapsulated, and non-acid-fast bacteria, which appears in kidney bean shape under the microscope. Gonorrhoea is a common sexually transmitted disease caused by Neisseria gonorrhoeae, a gram-negative diplococci. In the modern era of broad-spectrum antibiotics, multiple urethral fistulae (watering can perineum) is one of the forgotten sequelae of chronic gonococcal infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C -Watering can perineum – a complication of Gonorrhoea. In women, gonorrhea can spread into the uterus or fallopian tubes and cause pelvic inflammatory disease (PID). Options B and D are the correct statements regarding gonorrhea.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Neisseria gonorrhoeae is an obligate human pathogen and is the etiological agent of gonorrhea. Syndromes include cervicitis in women and urethritis, pharyngitis, and proctitis in both sexes. The virulence factor of N. gonorrhoeae includes all of the following:", "options": [{"label": "A", "text": "Pili", "correct": false}, {"label": "B", "text": "LOS", "correct": false}, {"label": "C", "text": "M protein", "correct": true}, {"label": "D", "text": "IgA1 protease", "correct": false}], "correct_answer": "C. M protein", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>M protein The M protein coats group A streptococci (GAS) and act as the primary antigen and determinant of type-specific immunity. M protein is essential for GAS virulence, providing antiphagocytic functions critical to survival in human tissues and fluids.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A- Pili (Fimbriae) Pili are the hairlike appendages that extend up to several micrometers from the gonococcal surface. They cause attachment to host cells and resist phagocytosis. Option B- In contrast to the enteric Gram-negative rods gonococcal lipopolysaccharide (LPS) does not have long O-antigen side chains and is called a lipooligosaccharide (LOS). Its MW is 3–7 kDa. Gonococci can express more than one antigenically different LOS chain simultaneously. Toxicity in gonococcal infections is largely attributable to the endotoxic effects of LOS. Option C- Gonococci has an IgA1 protease that splits and inactivates IgA1, a major mucosal immunoglobulin of humans. N. meningitides, H. influenza, and Streptococcus pneumoniae elaborate similar IgA1 proteases.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are true about N. gonorrhoeae except:", "options": [{"label": "A", "text": "Is an exclusively human pathogen", "correct": false}, {"label": "B", "text": "Some strains cause disseminated disease", "correct": false}, {"label": "C", "text": "Acute urethritis is the most common manifestation in male", "correct": false}, {"label": "D", "text": "All strains are highly sensitive to penicillins", "correct": true}], "correct_answer": "D. All strains are highly sensitive to penicillins", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All strains are highly sensitive to penicillins Steadily and relentlessly, the bacterium that causes gonorrhea has slipped past medicine's defenses, acquiring resistance to once-reliable drugs, including penicillin. Not just penicillin, nowadays the major concern for gonococcus treatment is Azithromycin resistance, especially in Asian countries.</p>\n<p><strong>Highyeild:</strong></p><p>Drug Resistance In Gonococcus Due to the selection of chromosomal mutants and to increase in the prevalence of penicillinase-producing N. gonorrhoeae (PPNG), CDC recommends dual antimicrobial therapy , an approach that will improve treatment efficacy and reduce the emergence of antimicrobial resistance. The preferred treatment of choice: Injectable ceftriaxone 250 mg IM once plus either azithromycin or doxycycline is recommended for the treatment of uncomplicated urethritis, cervicitis, and proctitis. The use of doxycycline also helps in treating chlamydia , which is a commonly associated co-infection. However, doxycycline cannot be used in pregnancy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - It is a Gram-negative, non-spore-forming, non-motile, encapsulated, and non-acid-fast bacteria, which appears in kidney bean shape under the microscope. an exclusive human pathogen Option B - Gonorrhoea is a common sexually transmitted disease caused by Neisseria gonorrhoeae, a gram-negative diplococci. Some strains cause disseminated disease Option C - The main clinical feature of gonococcal urethritis in men is a urethral discharge, which is often profuse-purulent and associated with dysuria So, Options A, B, and C are all correct statements about N. gonorrhoeae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is Least susceptible to gonococcal infection:", "options": [{"label": "A", "text": "Anterior urethra", "correct": false}, {"label": "B", "text": "Testis", "correct": true}, {"label": "C", "text": "Prostate", "correct": false}, {"label": "D", "text": "Epididymis", "correct": false}], "correct_answer": "B. Testis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Testis The main symptom in males is urethritis. Testis is usually spared due to its lower temperature as compared to the body.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C and D - Gonorrhea infections can spread to higher portions of the reproductive tract, causing prostatitis (prostate inflammation) and epididymitis (inflammation of the epididymis) in men, and pelvic inflammatory disease (PID) in women. Gonorrhoea is a common sexually transmitted disease caused by Neisseria gonorrhoeae, a gram-negative diplococci. Option A - The main clinical feature of gonococcal urethritis in men is a urethral discharge, which is often profuse, purulent, and associated with dysuria. Infection may spread to periurethral tissues in males causing abscesses with sinus formation (known as water-can perineum).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In women, gonorrhea can spread to the reproductive organs and cause pelvic inflammatory disease (PID). This is estimated to occur in 10 to 20% of cases of untreated gonorrhea. PID can lead to long-term pelvic pain, ectopic pregnancy, and infertility. Which is not a metastatic complication of Gonorrhea:", "options": [{"label": "A", "text": "Endocarditis", "correct": false}, {"label": "B", "text": "Meningitis", "correct": false}, {"label": "C", "text": "Nephritis", "correct": true}, {"label": "D", "text": "Arthritis", "correct": false}], "correct_answer": "C. Nephritis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nephritis Nephritis is not a complication of gonococcal infection. The organism may also cause local or metastatic complications.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A -Gonococcal endocarditis, which is damage to the inner lining of the heart muscle. Option B -Gonococcal meningitis, which is an infection of the membranes covering the brain and spinal cord. Option D - Gonococcal arthritis, which involves rashes and inflammation of the joints.</p>\n<p><strong>Extraedge:</strong></p><p>Complications of Gonococcus: In women, infertility occurs in 20% of cases of gonococcal salpingitis . Chronic gonococcal cervicitis and proctitis are often asymptomatic. Gonococcal bacteremia causes skin lesions (especially hemorrhagic papules and pustules) on the hands, forearms, feet, and legs and to tenosynovitis and suppurative arthritis , of the knees, ankles, and wrists. Bacteria can be cultured from blood or joint fluid in only 30% of patients with gonococcal arthritis. Gonococcal endocarditis is an uncommon but severe infection. Gonococci rarely can cause meningitis and eye infections in adults ; these have manifestations similar to those caused by meningococci. Complement deficiency is usually associated with gonococcal bacteremia. Patients with recurrent gonococcal bacteremia should be tested for total hemolytic complement activity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A pap smear from a woman with chronic cervicitis shows cytoplasmic inclusions within epithelial cells. Fluorescent antibodies identify both these inclusions and elementary bodies. The intracellular organisms causing the infection are unusual because they cannot synthesize:", "options": [{"label": "A", "text": "ATP adenosine triphosphate", "correct": true}, {"label": "B", "text": "Cholesterol", "correct": false}, {"label": "C", "text": "DNA Deoxyribonucleic Acid", "correct": false}, {"label": "D", "text": "Proteins", "correct": false}], "correct_answer": "A. ATP adenosine triphosphate", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>ATP adenosine triphosphate Chlamydiae can be viewed as Gram-negative bacteria that lack mechanisms for the production of metabolic energy and cannot synthesize adenosine triphosphate (ATP). All chlamydiae exhibit similar morphologic features, share a common group antigen, and multiply in the cytoplasm of their host cells by a distinctive developmental cycle. This restricts them to an intracellular existence, where the host cell furnishes energy-rich intermediates. Thus, chlamydiae are obligate intracellular pathogens . Options B, C, and D are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which two sexually transmitted infections can pass from mother to fetus causing eye infections?", "options": [{"label": "A", "text": "Syphilis and gonorrhea", "correct": false}, {"label": "B", "text": "Chlamydia and gonorrhea", "correct": true}, {"label": "C", "text": "Herpes and PID Pelvic inflammatory disease", "correct": false}, {"label": "D", "text": "HPV Human papillomaviruses and PID Pelvic inflammatory disease", "correct": false}], "correct_answer": "B. Chlamydia and gonorrhea", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chlamydia and gonorrhea Chlamydia can be passed from women to their babies during vaginal delivery. Some STDs/STIs, including chlamydia, gonorrhea, genital herpes, etc can be passed from mother to infant perinatally.</p>\n<p><strong>Highyeild:</strong></p><p>Gonococcal ophthalmia neonatorum, an infection of the eye in newborns, is acquired during passage through an infected birth canal. The initial conjunctivitis rapidly progresses and, if untreated, results in blindness. To prevent gonococcal ophthalmia neonatorum, the instillation of erythromycin ointment into the conjunctival sac of newborns is done in many developed countries. Neonatal chlamydial infection , which manifests principally as ophthalmia neonatorum (ON) or pneumonia , is a significant cause of neonatal morbidity. Widespread use of silver nitrate drops resulted in a dramatic decline in the incidence of gonococcal ophthalmia but had much less impact on the incidence of neonatal chlamydial infection. Chlamydia trachomatis has become the most common infectious cause of ON in developed countries. Prophylaxis with 0.5% erythromycin ophthalmic ointment or 1% tetracycline ointment has comparable efficacy for the prevention of chlamydial ophthalmia.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - Syphilis is not responsible for any congenital eye infection. Options C and D - Herpes is transmitted perinatally but it does not cause any eye infection per se. It can cause vesicles near the eye. PID is not transmitted in utero and neither does it cause eye infection. HPV is not associated with any neonatal ophthalmic infection.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Chlamydia affects people of all ages but is most common in young women. In many cases, it can be asymptomatic, but infectious. Symptoms may include genital pain and vaginal discharge. Which of the following is not true about Chlamydia trachomatis?", "options": [{"label": "A", "text": "Most of the patients are asymptomatic.", "correct": false}, {"label": "B", "text": "A culture of purulent cervical discharge is used for diagnosis.", "correct": true}, {"label": "C", "text": "Tetracycline therapy is very effective.", "correct": false}, {"label": "D", "text": "OC pill users are the Carriers", "correct": false}], "correct_answer": "B. A culture of purulent cervical discharge is used for diagnosis.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>A culture of purulent cervical discharge is used for diagnosis. Culture is not used for the diagnosis of trachomatis. It is essentially a non-culturable bacteria due to its obligate intracellular nature.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - most patients are asymptomatic but communicable to sex partners. Option C - Tetracycline is used to treat many different bacterial infections of the skin, intestines, respiratory tract, urinary tract, genitals, lymph nodes, and other body systems. Option D - OC pill users are the Carriers, as barrier contraception isn't used, the asymptomatic carriers can still pass on the infection. Multiple-dose regimens of tetracyclines doxycycline or tetracycline achieve microbiological cure in at least 95% of men and non-pregnant women with genital chlamydia. The two most commonly prescribed antibiotics for chlamydia are azithromycin – given as 2 or 4 tablets at once. doxycycline – given as 2 capsules a day for a week. Options A, C, and D are correct statements about C. trachomatis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "What diagnostic test is best to identify an infection with Chlamydia trachomatis?", "options": [{"label": "A", "text": "Aerobic and anaerobic blood cultures", "correct": false}, {"label": "B", "text": "Stool culture", "correct": false}, {"label": "C", "text": "DNA probe", "correct": true}, {"label": "D", "text": "Urine culture", "correct": false}], "correct_answer": "C. DNA probe", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>DNA probe NAAT is a molecular test that detects the genetic material (DNA) of Chlamydia trachomatis. DNA hybridization probe, ie. NAAT is the most accessible and commonly used diagnostic method for C. trachomatis. It is generally more sensitive and specific than other chlamydia tests and can be performed on a vaginal swab on women, or urine from both men and women, which eliminates the need for a pelvic exam in women.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B and D - Culturing Chlamydia is not an option for diagnosis. Being an obligate intracellular organism, culture is restricted to Cell culture- McCoy cell line Clinical specimens should be inoculated onto cycloheximide-treated monolayer cultures of McCoy cells or other appropriate cells. Inoculation involves centrifugation of the specimen onto the cell monolayer followed by incubation for 48 h to 72 h and staining for intracytoplasmic inclusions . This isn’t an option of choice for rapid diagnosis due to its tedious nature, unavailability, and high levels of expertise requirement. Options A, B, and D are different from the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The two pathogenic Neisseria species, N. meningitidis and N. gonorrhoeae, differ from the non pathogenic Neisseria species in that:", "options": [{"label": "A", "text": "The former are less resistant to certain antibiotics than the non-pathogenic species.", "correct": false}, {"label": "B", "text": "The pathogenic species are oxidase positive.", "correct": false}, {"label": "C", "text": "The pathogenic species grows in enriched chocolate agar.", "correct": true}, {"label": "D", "text": "The non-pathogenic species do not grow well at room temperature.", "correct": false}], "correct_answer": "C. The pathogenic species grows in enriched chocolate agar.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The pathogenic species grows in enriched chocolate agar. Gram Negative, strict aerobe, diplococci, Non motile, non sporing. Neisseria spp. are common commensals of mouth and URT. eg. N lactamica, N.sicca, N.flavescens. Neisseria gonorrhoeae and N. meningitidis are true human pathogens, surviving best in the human host. Gram's stain : Adjacent sides are flat- N meningitidis Adjacent sides concave; kidney shaped-N gonorrhoeae Media: Thayer-Martin agar is a selective media used for the isolation of Neisseria. It uses a combination of Vancomycin, Colistin, and Nystatin (VCN). Modified Thayer Martin agar uses trimethoprim in addition .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A- Drug resistance is an entity that does not decipher between a pathogen and a commensal. Option B: All Neisseria are oxidase positive. Option D: Normal flora (non-pathogenic) Neisseria will grow at room temperature on a simple/basal medium.</p>\n<p><strong>Extraedge:</strong></p><p>Diagnosis Of Neisseria And Related Species (Clinically Important) Species Glucose Maltose Sucrose Lactose N. gonorrhoea + - - - N. meningitidis + + - - N. sicca + + + - M. catarrhalis - - - -</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 24 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "An 18-year-old girl complains of abnormal vaginal discharge and frequent itching, tenderness, and burning in the vulvovaginal area. On examination, there is erythema and smelly discharge. The results of a wet mount examination are shown in the image. Which organism is responsible?", "options": [{"label": "A", "text": "Gardnerella vaginalis", "correct": true}, {"label": "B", "text": "Trichomonas vaginalis", "correct": false}, {"label": "C", "text": "Chlamydia", "correct": false}, {"label": "D", "text": "Staphylococcus aureus", "correct": false}], "correct_answer": "A. Gardnerella vaginalis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254854393-QTDV075001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Gardnerella vaginalis The diagnosis of bacterial vaginosis is the most likely diagnosis in this clinical vignette. The image demonstrates the CLUE- CELLS - the gardanella vaginalis studded epithelial cells. Bacterial vaginosis is dysbiosis of the vaginal flora mostly common in sexually active females but can occur in virgins as well. It is a decrease in lactobacilli, thereby increasing the vaginal pH with an increase in Gardnerella vaginalis and mobiluncus spp (curved, small gram-negative C- shaped bacilli) Amsel’s criterion/Clinical diagnosis of BV requires the presence of three of the following four characteristics: (i) pH > 4.5; (ii) clue cells; (iii) homogeneous, thin, smelly grey-white discharge; (iv) fishy odor on the addition of 10% KOH (Whiff test).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: Trichomonas vaginalis is an anaerobic, flagellated protozoan parasite and the causative agent of trichomoniasis. Option C: Chlamydia, or more specifically a chlamydia infection, is a sexually transmitted infection caused by the bacterium Chlamydia trachomatis which has no symptoms for 50–70% of women infected. It is not associated with such a wet mount picture. Option D: Staphylococcus aureus is a Gram-positive, round-shaped bacterium.</p>\n<p><strong>Extraedge:</strong></p><p>Nugent scoring of Gram stained smear for bacterial vaginosis. Organism Morpho type Number/oil immersion field Score Lactobacillus - like (parallel sided, gram positive rods) >30 0 5-30 1 1-4 2 <1 3 0 4 Mobiluncus like (curved, gram negative rods) >5 2 <1-4 1 0 0 Gardnerella/bacteroideslike (tiny, gram variable coccobacilli and pleomorphic rods with vacuoles) >30 4 5-30 3 1-4 2 <1 1 0 0 A clue cell studded with gram variable coccobacilli (Gardnerella vaginalis) with serrated or obliterated epithelial cell margins. It is a pathognomonic finding of bacterial vaginosis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 16-year-old girl presents to the pediatrician with her mother for her pre-college check-up. She has no past medical history. After her mother leaves the room for the social history component, the girl admits to having sex with her boyfriend for the first time two weeks ago and complains of a yellow-green malodorous vaginal discharge that started a week ago with mild pelvic pain. A pelvic exam is performed and mild cervical tenderness is noted. The cervix is pink, nulliparous, inflamed, and covered by small red punctate spots. A thin yellow-green frothy discharge of fishy odor is also detected. A wet prep is made and reveals squamous cells and numerous motile organisms. what is the most likely causative organism of the patient’s condition?", "options": [{"label": "A", "text": "Gonorrhea", "correct": false}, {"label": "B", "text": "Trichomonas vaginalis", "correct": true}, {"label": "C", "text": "Candida albicans", "correct": false}, {"label": "D", "text": "Gardnerella Vaginalis", "correct": false}], "correct_answer": "B. Trichomonas vaginalis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichomonas vaginalis Trichomonas vaginalis is a vaginal protozoon which causes trichomoniasis. It is transmitted sexually and the infective form is a trophozoite with 5-pair flagella. Yellow-green malodorous vaginal discharge & extensive pruritis. colposcopy examination reveals multiple red punctate spots on the cervix called strawberry cervix/colpitis Macularis</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: A. Gonorrhea Gonorrhea is caused by Neisseria gonorrhea, a gram-negative coccus it causes Urethritis in males & cervicitis in females There is no association with a flagellated parasite. Option: C. Candida albicans Candida albicans can cause genital tract infections in females characterized by curdy white discharge & intense pruritis On wet mount budding yeast yells will be seen. Option: D. Gardnerella Vaginalis Gardnerella Vaginalis causes Bacterial vaginosis with is characterized by Clue cells & Amsel’s criteria</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following organism is presented in the life cycle given below:", "options": [{"label": "A", "text": "Trypanosoma", "correct": false}, {"label": "B", "text": "Trichomonas", "correct": true}, {"label": "C", "text": "Giardia lamblia", "correct": false}, {"label": "D", "text": "Gardnerella Vaginalis", "correct": false}], "correct_answer": "B. Trichomonas", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254855467-QTDV075003IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Trichomonas Trichomonas vaginalis is a vaginal protozoon which causes trichomoniasis. It is transmitted sexually and the infective form is a trophozoite with 5 pairs of flagella.</p>\n<p><strong>Highyeild:</strong></p><p>T. Vaginalis: On microscopic examination of genital specimens, T. vaginalis is a pear-shaped organism (10 x 7 micrometers) with twitching motility. There are four anterior flagella that arise from a single stalk and a fifth flagellum which is embedded in the undulating membrane. Most infected men are asymptomatic, but those who are symptomatic have urethritis. Complications of vaginal trichomoniasis include vaginitis emphysematous (gas-filled blebs on the vaginal wall), and vaginal cuff cellulitis after hysterectomy. It may be associated with premature labor, and low- birthweight infants. Metronidazole is the treatment of choice with 2gm given as a single dose. flagellated parasites, pear-shaped.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A - Trypanosoma is a tissue flagellate that has a human as the definitive host and a vector (tsetse fly) as an intermediate host which plays an important role in the pathogenesis Option C - giardia lamblia is intestinal protozoa that cause malabsorption & Chronic Diarrhea Option D - Gardnerella Vaginalis is a causative organism for bacterial vaginosis which is characterized by clue cells.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old G4P301LC3 woman presents to the OPD for a visit, with a 6-day history of vaginal discharge with an unpleasant odor. On speculum examination, the discharge was green in color and frothy in appearance. Is noticed vulvar erythema, edema, and pruritus, also is noted in the characteristic erythematous, punctate epithelial papillae or “strawberry” appearance of the cervix. The vaginal pH was 6.2. Wet mount microscopic examination of vaginal swabs was done. Per-speculum. findings are given below. Which of the following is the appropriate management of the patient's condition:", "options": [{"label": "A", "text": "Azithromycin", "correct": false}, {"label": "B", "text": "Ceftriaxone", "correct": false}, {"label": "C", "text": "Metronidazole", "correct": true}, {"label": "D", "text": "Ciprofloxacin", "correct": false}], "correct_answer": "C. Metronidazole", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689254855801-QTDV075004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Metronidazole The given history on the images shows a strawberry-like vagina (pinpoint hemorrhages). And the wet Mount show flagellated organism that is trichomonas vaginalis Drug of choice for trichomonas vaginalis is metronidazole.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. azithromycin - not the correct option. Option B. Ceftriaxone - not the correct option. Option D. Ciprofloxacin - is not the correct option. So, Options A, B, and D are different from the correct options.</p>\n<p><strong>Extraedge:</strong></p><p>Treatment of T. vaginalis Metronidazole is the treatment of choice and can be given as a single 2g dose or in divided doses for 7 days. The main disadvantage of a single dose is the risk of reinfection only if the partner is not treated simultaneously. Alternative drug- tinidazole w hich can be given as a single dose. Patients should avoid alcohol with the treatment because of the risk of disulfiram reactions these drugs</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A protozoan with characteristic jerky motility is most often observed in which of the following?", "options": [{"label": "A", "text": "Pus aspirate", "correct": false}, {"label": "B", "text": "Duodenal contents", "correct": false}, {"label": "C", "text": "Sputum", "correct": false}, {"label": "D", "text": "Vaginal secretions", "correct": true}], "correct_answer": "D. Vaginal secretions", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vaginal secretions T vaginalis can be differentiated on the basis of its characteristic jerky movements. On occasion, Motility is very dependent on the temperature of the specimen and is observed only in freshly collected specimens, best with 2 hrs of collection. Trichomoniasis can be diagnosed by looking at a sample of vaginal fluid for women or urine for men under a microscope. If this test isn't conclusive, tests called rapid antigen tests and nucleic acid amplification may be used.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C: no flagellated organisms are seen in these samples.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Trichomoniasis is caused by a one-celled protozoan, a type of tiny parasite called Trichomonas vaginalis. The parasite passes between people during genital contact, including vaginal, oral, or anal sex. The infection can be passed between men and women, women, and sometimes men The specimen that is least likely to provide recovery of Trichomonas vaginalis is:", "options": [{"label": "A", "text": "Urine", "correct": false}, {"label": "B", "text": "Urethral discharge", "correct": false}, {"label": "C", "text": "Prostatic discharge", "correct": false}, {"label": "D", "text": "Feces", "correct": true}], "correct_answer": "D. Feces", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Feces Of all the trichomonads, only the common genitourinary tract inhabitant T vaginalis causes genital disease. Trichomonas vaginalis, a flagellate, is the most common pathogenic protozoan of humans in industrialized countries. Feces may demonstrate a nonpathogenic trichomonas species called T. hominis which shows similar motility as T. vaginalis but is not associated with the disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B, and C- all these samples harbor or can harbor this sexually transmitted parasite.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "You see a 20-year-old female for complaints of vaginal itching, discharge, and pain with intercourse. She has had 3 different sexual partners over the past 2 years. As part of your workup, you do a wet mount of vaginal secretions and see a flagellated organism about the size of a white blood cell with \"twitching motility\" that makes you think of Trichomonas vaginalis. Which statement is false regarding Trichomonas?", "options": [{"label": "A", "text": "Men are most likely asymptomatic but efficient transmitters of this organism", "correct": false}, {"label": "B", "text": "The cyst form of the life cycle is the most common method of transmission", "correct": true}, {"label": "C", "text": "Simultaneous treatment of the patient and her sexual contacts will decrease the chance of recurrences", "correct": false}, {"label": "D", "text": "In severe cases, the regional mucosa may be red with petechial lesions and the cervix has been described as a \"strawberry cervix\".", "correct": false}], "correct_answer": "B. The cyst form of the life cycle is the most common method of transmission", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The cyst form of the life cycle is the most common method of transmission T. vaginalis has no CYSTIC stage, only pear-shaped trophozoites with median body and 5 flagella found. The trophozoite form is a pathogenic, infective, and diagnostic stage. vaginalis causes vaginitis in females and urethritis in males. Trichomonas vaginalis, a flagellate, is the most common pathogenic protozoan which it replicates by binary fission. Trichomonas vaginalis is the causative agent of trichomoniasis, a common cause of vaginitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Men are most likely asymptomatic but efficient transmitters of this organism Option C. Simultaneous treatment of the patient and her sexual contacts will decrease the chance of recurrences. It is a crucial part of patient management to prevent a recurrence. Option D. In severe cases the regional mucosa may be red with p etechial lesions/ punctate hemorrhages and the cervix has been described as a \"strawberry cervix\" . So, Options A, C, and D are true statements.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 17 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 32-year-old man is brought to the emergency department due to fever, agitation, and disorientation. According to his family, the patient has been acting strangely and seeing and hearing things that do not exist. He also drools excessively and has severe, painful throat spasms when he attempts to eat or drink. The patient returned 4 weeks ago from a camping trip in Jaisalmer, where he was bitten by a pet. Physical examination shows a confused and combative patient with mydriasis and neck rigidity. Which of the following acts as an entry receptor for the causative agent of this patient's condition?", "options": [{"label": "A", "text": "B-lymphocyte CD21", "correct": false}, {"label": "B", "text": "Muscle acetylcholine receptors", "correct": true}, {"label": "C", "text": "Nasopharyngeal intracellular adhesion molecule-1", "correct": false}, {"label": "D", "text": "Respiratory epithelial sialic acids", "correct": false}], "correct_answer": "B. Muscle acetylcholine receptors", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Muscle acetylcholine receptors This patient's progressive agitation, disorientation, and pharyngospasm raise a strong suspicion of rabies , a fatal infection caused by a neurotrophic virus from the Rhabdoviridae family . Exposure usually occurs when patients come into contact with contaminated saliva from an infected animal (eg, dog, bat), v1hich which likely occurred during this patient's camping trip in New Mexico Jaisalmer.</p>\n<p><strong>Highyeild:</strong></p><p>The virus contains a bullet-shaped envelope with knob-like glycoproteins that allow it to attach to the nicotinic acetylcholine receptor at the neuromuscular junction. The virus replicates locally within the muscle tissue of the bite wound for several days or weeks and then travels in a retrograde fashion through peripheral nerve axons to the dorsal root ganglia. From there, it rapidly ascends the spinal cord and infects the diencephalon, hippocampus, and brain stem. Patients initially develop a nonspecific flu-like prodrome (fever, malaise, myalgias); paresthesias radiating proximally from a known wound site can be an important clue. When the virus enters the CNS, the infection typically evolves into rabies encephalitis, which is characterized by painful pharyngeal spasms leading to avoidance of water (hydrophobia), mental status changes, muscular rigidity, and autonomic dysfunction (pupil dilation, hypersalivation). Once symptoms of rabies encephalitis appear, post-exposure prophylaxis is no longer effective and nearly all patients die.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Epstein-Barr virus binds to CD21 on inactive B-lymphocytes and results in infectious mononucleosis, which is usually characterized by sore throat, swollen lymph nodes, malaise, and atypical lymphocytosis. Because this virus is a member of the Herpesviridae family, initial infection is followed by a long-standing (usually asymptomatic) latent infection. Option C. Rhinovirus binds intracellular adhesion molecule-1, which is found on nasopharyngeal and adenoid epithelial cells. It is associated with the common cold, not agitation, pharyngeal spasms, and hallucinations. Option D. Th e influenza virus has hemagglutinin glycoproteins that allow it to attach to sialic acids on the surface of the respiratory epithelium. Influenza is usually characterized by fever, myalgias, cough, headache, and respiratory symptoms; agitation and pharyngeal spasm are not typical features.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old boy is brought to the emergency department by his parents with a 2-day history of fever and headaches. The parents report that he vomited once this afternoon. All of his vaccinations are up-to-date and he has no significant past medical history. His temperature is 38.7 C (102 F). Examination shows mild pharyngeal erythema in addition to neck stiffness. Cerebrospinal fluid analysis reveals the following: Glucose: 65 mg/dL Protein: 85 mg/dL Leukocytes: 300/mm3 Differential Neutrophils: 15% Lymphocytes: 85% Red blood cells: none Which of the following infectious agents is most likely to have caused this patient's illness?", "options": [{"label": "A", "text": "Coronavirus", "correct": false}, {"label": "B", "text": "Cryptococcus neoformans", "correct": false}, {"label": "C", "text": "Enterovirus", "correct": true}, {"label": "D", "text": "Mumps virus", "correct": false}], "correct_answer": "C. Enterovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterovirus This child has clinical evidence of meningitis (fever, headache, vomiting, stiff neck). Analysis of the cerebrospinal fluid (CSF) shows normal glucose, marginally elevated protein, and pleocytosis with a lymphocytic predominance. This pattern suggests aseptic meningitis, which is usually viral in etiology. Enteroviruses (eg, coxsackievirus, echovirus, poliovirus) are responsible for > 90% of cases.</p>\n<p><strong>Highyeild:</strong></p><p>Clinical symptoms are similar to meningitis caused by bacterial or fungal pathogens. However, aseptic meningitis is generally less severe, and focal neurologic signs, seizures, and alterations in mental status are absent. The presence of any of these should prompt consideration of other conditions, including bacterial meningitis, encephalitis, and intracranial hemorrhage. A negative Gram stain and sterile culture will further support the diagnosis of aseptic meningitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Coronavirus is a common cause of cold symptoms. It is not a common cause of viral meningitis. Option B. Cryptococcus neoformans is a common cause of meningitis in immunocompromised patients (eg, AIDS patients) . The diagnosis is made by testing for cryptococcal antigens or by identifying India ink-stained organisms in the CSF. Option D. The mumps virus can cause aseptic meningitis, but this would be extremely unlikely in this fully immunized child. Meningitis caused by mumps is accompanied by parotitis in 50% of cases.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 17-year-old boy is hospitalized with recent-onset insomnia, headaches, periodic agitation, and dysphagia. He is a high school student interested in becoming a veterinarian. He owns a snake, fish, and parrot and, about 4 weeks ago, went on a field trip to study bats in a cave. The patient has no known medical problems and is not taking any medications. He does not consume alcohol and has never used illicit drugs. Despite hospitalization and treatment, he develops painful spasms, progressive paralysis, and coma and dies. Which of the following interventions would have most likely prevented this student from developing this illness?", "options": [{"label": "A", "text": "Cellular receptor inhibitor drug", "correct": false}, {"label": "B", "text": "Inactivated vaccine", "correct": true}, {"label": "C", "text": "Interferon therapy", "correct": false}, {"label": "D", "text": "Live attenuated vaccine", "correct": false}], "correct_answer": "B. Inactivated vaccine", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Inactivated vaccine Restlessness, agitation, and dysphagia progressing to coma within weeks of exploring a bat cave are concerning for rabies encephalitis. Many patients with bat rabies are not aware that they had been bitten. Once in a wound, the virus travels retrograde via peripheral nerves to the dorsal root ganglia and then to the brain, where replication occurs.</p>\n<p><strong>Highyeild:</strong></p><p>The virus then spreads to other organs through neural pathways. Common manifestations include a nonspecific, flu-like prodrome followed by an acute neurologic syndrome with agitation, persistent fever, variable consciousness, and painful spasms with swallowing or inspiration (causing dysphagia, hydrophobia, and aerophobia). Generalized flaccid paralysis and coma ensue, with most patients dying within weeks. Prophylactic vaccination is recommended for individuals at high exposure risk (eg, veterinarians, cave explorers, laboratory workers handling infected tissues, travelers to countries where rabid dogs are prevalent). Postexposure prophylaxis (a medical emergency) generally includes rabies immune globulin and vaccination ; it is not effective after symptom onset. The approved rabies vaccines consist of various rhabdovirus strains grown in tissue cell culture and inactivated by beta-propiolactone.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & C. No anti-rabies drugs targeting specific viral pathways (eg, cellular entry) are available, and interferon is not used in rabies management. Option D. Some live attenuated rabies vaccines have been used in wild animal populations, but none are currently recommended in humans. The herpes zoster (shingles), varicella, and yellow fever vaccines are live attenuated.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A boy picked up a grounded bat and was bitten on the hand, suffering a slight wound. In addition to flushing the wound, cleaning it surgically, and giving anti-tetanus prophylaxis and antibiotics as indicated, the physician should immediately perform which of the following?", "options": [{"label": "A", "text": "Observe the boy very carefully", "correct": false}, {"label": "B", "text": "Order a search for the attacking bat for autopsy", "correct": false}, {"label": "C", "text": "Report the incident to the state epidemiologist", "correct": false}, {"label": "D", "text": "Start rabies vaccine and give anti-rabies Serum", "correct": true}], "correct_answer": "D. Start rabies vaccine and give anti-rabies Serum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Start rabies vaccine and give anti-rabies Serum If exposure to rabies virus appears definite, as in this case , treatment with human diploid cell live-derived vaccine and hyperimmune anti-rabies gamma globulin should be started immediately. Serum antibodies provide an immediate barrier to the growth of the virus; meanwhile, antibodies are elicited by the vaccine. If the level of exposure is minimal (e.g., no skin puncture) and the animal probably is not rabid, the vaccine is not recommended.</p>\n<p><strong>Highyeild:</strong></p><p>Initiation of the rabies vaccine will lead to the production of antibodies against the rabies virus, but it will require approximately 2 weeks to develop protective antibodies. By that time, severe damage may have already occurred. Postexposure immunization and human rabies immunoglobulin is the best approach.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Observation of the patient will cause a delay in the treatment and may cause serious damage to the patient. Option B. Ordering a search for the attacking fox for an autopsy to determine if it has rabies is like searching for a needle in a haystack, and thus not the best approach to address a possible rabies infection, which requires immediate actions Option C. Reporting of the incident to the state epidemiologist does not address the real needs of an individual running the risk of rabies.</p>\n<p><strong>Extraedge:</strong></p><p>Postexposure prophylaxis (PEP) consists of a dose of human rabies immune globulin (HRIG) and rabies vaccine given on the day of the rabies exposure, and then a dose of vaccine given again on days 3, 7, and 14.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old boy named Aravind was taken to the emergency room. The boy suddenly became unconscious while playing a soccer game. He lives in an orphanage. He had mild mental deterioration, involuntary movements, muscular rigidity, and double vision. The temperature is 98.5F, and CSF cerebrospinal fluid analysis shows normal glucose, normal protein, normal neutrophils, and slightly increased lymphocyte levels. MRI magnetic resonance imaging and CT computer tomography show no swelling, no hemorrhage, or abnormal deposition. The boy has successfully completed the vaccination to date. Which of the following is the most appropriate cause for this situation?", "options": [{"label": "A", "text": "Rabies Virus", "correct": false}, {"label": "B", "text": "JC Virus", "correct": false}, {"label": "C", "text": "Varicella Zoster Virus", "correct": false}, {"label": "D", "text": "Measles", "correct": true}], "correct_answer": "D. Measles", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Measles Subacute Sclerosing Panencephalitis (SSPE) is a rare complication of the Measles virus which can manifest after 5 to 10 years of birth MEASLES INFECTION. Here the boy lives in an orphanage so no antenatal history of the mother. He is vaccinated to date so he is not immunocompromised.</p>\n<p><strong>Highyeild:</strong></p><p>The CSF analysis is not much significant for any acute infection. A slight increase in lymphocytes may tell about some viral infection. Here the mother may get infected with Measles during her early pregnancy which can infect the child even in the intrauterine life. This can lead to Subacute Sclerosing Panencephalitis in 5-15 years of age.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Rabies can cause encephalitis but there was no history of any bite by a rabid animal. The clinical features of rabies include Hyperexcitability (anxiety and agitation), increased salivation and lacrimation, and hydrophobia (spasm of laryngeal and pharyngeal muscles). It has a 100 percent mortality rate that leads to coma and death. Option B. John Cunningham Virus (JC virus) can cause Progressive Multifocal Leukoencephalopathy (PMLE) mostly in HIV patients and lymphoma . PMLE is a type of encephalitis that is due to demyelination in subcortical white matter. It is characterized by ataxia, aphasia, hemiparesis, and visual field defects. Option C. Varicella Zoster Infection in the perinatal period can cause encephalitis in the newborn. Encephalitis due to Varicella Zoster Infection is mainly seen in immunocompromised persons and infants.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "True statement about NIPAH (Nipah henipavirus) except:", "options": [{"label": "A", "text": "It causes encephalitis", "correct": false}, {"label": "B", "text": "It was recently reported in India", "correct": false}, {"label": "C", "text": "Reservoir is fruit bats (Pteropus bat species)", "correct": false}, {"label": "D", "text": "Mortality rates are ~10 percent", "correct": true}], "correct_answer": "D. Mortality rates are ~10 percent", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mortality rates are ~10 percent Nipah virus infection: Human infections range from asymptomatic infection to acute respiratory infection, and fatal encephalitis(option A). A Nipah virus infection is a viral infection caused by the Nipah virus.</p>\n<p><strong>Highyeild:</strong></p><p>Symptoms from infection vary from none to fever, cough, headache, and shortness of breath. The case fatality rate is estimated at 40 percent to 75 percent. This rate can Nipah virus can be transmitted to humans from animals such as bats (reservoir) or pigs (amplifier). Within one to two days the disease can result in coma and death. The Nipah virus has a mortality rate of 40- 70 percent.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Nipah virus can cause encephalitis (swelling of the brain) Option B. Nipah virus outbreak was reported in Kerala in the year 2018, and traced to the fruit bats in the area. Option C. Reservoir for Nipah virus is fruit bats</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is not spread by the mosquito shown in the pictogram?", "options": [{"label": "A", "text": "Dengue fever", "correct": false}, {"label": "B", "text": "Chikungunya", "correct": false}, {"label": "C", "text": "Japanese Encephalitis", "correct": true}, {"label": "D", "text": "Yellow fever", "correct": false}], "correct_answer": "C. Japanese Encephalitis", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687505081768-QTDV014007IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Japanese Encephalitis JEV is transmitted to humans through bites from infected mosquitoes of the Culex species (mainly Culex tri Taeniorhynchus ). Humans, once infected, do not develop sufficient viremia to infect feeding mosquitoes. The virus exists in a transmission cycle between mosquitoes, pigs, and/or water birds (enzootic cycle).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Dengue is spread through the bite of the female mosquito (Aedes aegypti). The mosquito becomes infected when it takes the blood of a person infected with the virus. After about one week, the mosquito can then transmit the virus while biting a healthy person. Infected mosquitoes can then spread the virus to other people through bites. Option B. Chikungunya virus is most often spread to people by Aedes aegypti and Aedes albopictus mosquitoes. These are the same mosquitoes that transmit dengue virus. Option D. Yellow fever virus is transmitted to people primarily through the bite of infected Aedes or Haemagogus species mosquitoes. Mosquitoes acquire the virus by feeding on infected primates (human or non-human) and then can transmit the virus to other primates (human or non-human).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All are transmitted by mosquitoes except:", "options": [{"label": "A", "text": "St Louis encephalitis virus", "correct": false}, {"label": "B", "text": "Murray Valley encephalitis", "correct": false}, {"label": "C", "text": "RSSE", "correct": true}, {"label": "D", "text": "West Nile fever virus", "correct": false}], "correct_answer": "C. RSSE", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>RSSE RSSE virus is most prevalent in the eastern part of the former Soviet Union and is transmitted by the tick Ixodes persulcatus. Flaviviruses are a large group of small, enveloped viruses responsible for a number of severe human diseases, including yellow fever, Japanese encephalitis, dengue hemorrhagic fever and TBE.</p>\n<p><strong>Highyeild:</strong></p><p>About 1 in 5 people who are infected develop a fever with other symptoms such as headache, body aches, joint pains, vomiting, diarrhea, or rash. Most people with febrile illness due to West Nile virus recover completely, but fatigue and weakness can last for weeks or months. Serious symptoms in a few people.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Saint Louis encephalitis (SLE) is a viral disease spread to people by the bite of an infected mosquito. Most people infected with the SLE virus have no apparent illness. Initial symptoms of those who become ill include fever, headache, nausea, vomiting, and tiredness. Option B. Murray Valley encephalitis virus is a zoonotic flavivirus endemic to northern Australia and Papua New Guinea. It is the causal agent of Murray Valley encephalitis. In humans, it can cause permanent neurological disease or death. MVEV is related to Kunjin virus, which has a similar ecology, but a lower morbidity rate. Option D. West Nile virus (WNV) is the leading cause of mosquito-borne disease in the continental United States. It is most commonly spread to people by the bite of an infected mosquito. Cases of WNV occur during mosquito season, which starts in the summer and continues through fall.</p>\n<p><strong>Extraedge:</strong></p><p>West Nile virus is a single-stranded RNA virus that causes West Nile fever. It is a member of the family Flaviviridae, from the genus Flavivirus, which also contains the Zika virus, dengue virus, and yellow fever virus. The virus is primarily transmitted by mosquitoes, mostly species of Culex.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is NOT true about JE?", "options": [{"label": "A", "text": "Humans are reservoirs", "correct": true}, {"label": "B", "text": "Pigs are amplifier hosts", "correct": false}, {"label": "C", "text": "Transmitted by Culex Vishnui", "correct": false}, {"label": "D", "text": "Vaccination of pigs can control transmission", "correct": false}], "correct_answer": "A. Humans are reservoirs", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Humans are reservoirs Japanese encephalitis virus (JEV) is a flavivirus related to dengue, yellow fever, and West Nile viruses, and is spread by mosquitoes. JEV is the main cause of viral encephalitis in many countries of Asia with an estimated 68 000 clinical cases every year.</p>\n<p><strong>Highyeild:</strong></p><p>Japanese encephalitis (JE) is an infection of the brain caused by the Japanese encephalitis virus (JEV). The virus exists in a transmission cycle between mosquitoes, pigs, and/or water birds ( enzootic cycle).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Pigs are amplifier hosts of Japanese encephalitis Option C. Culex Vishnu is the major vector responsible for the transmission of the Japanese encephalitis virus Option D. Vaccination of pigs with an attenuated Japanese encephalitis virus can control transmission.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The commonest viruses causing meningoencephalitis is:", "options": [{"label": "A", "text": "Arboviruses", "correct": false}, {"label": "B", "text": "Enteroviruses", "correct": true}, {"label": "C", "text": "Herpes viruses", "correct": false}, {"label": "D", "text": "Mumps viruses", "correct": false}], "correct_answer": "B. Enteroviruses", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enteroviruses N on-polio enteroviruses are the most common cause of viral meningitis especially from late spring to fall(option B). That is when these viruses spread most often. However, only a small number of people infected with enteroviruses will actually develop meningitis.</p>\n<p><strong>Highyeild:</strong></p><p>The regions of the CNS are affected by enteroviruses that cause encephalitis, and meningitis. Viral meningitis is usually mild and often clears on its own. Most cases in the United States are caused by a group of viruses known as enteroviruses, which are most common in late summer and early fall. Enteroviruses. Coxsackie or Echovirus groups of enteroviruses are the most common cause of viral meningitis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A, C, and D. Not the commonest viruses causing meningoencephalitis.</p>\n<p><strong>Extraedge:</strong></p><p>Poliovirus, the causative agent of polio, is a serotype of the species Enterovirus C, in the family of Picornaviridae. There are three poliovirus serotypes: types 1, 2, and 3. Poliovirus is composed of an RNA genome and a protein capsid.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A neonate develops encephalitis without any skin lesions. The most sensitive test for the diagnosis of viral meningitis in a newborn infant is?", "options": [{"label": "A", "text": "Tzanck smear", "correct": false}, {"label": "B", "text": "HSV culture", "correct": false}, {"label": "C", "text": "HSV IgG antibody", "correct": false}, {"label": "D", "text": "HSV polymerase chain reaction", "correct": true}], "correct_answer": "D. HSV polymerase chain reaction", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HSV polymerase chain reaction Although skin lesions are the most commonly recognized feature of the disease many infants do not develop Skin lesions until well into the course of the disease.</p>\n<p><strong>Highyeild:</strong></p><p>Most cases of neonatal infection are due to HSV 2 so it can be said that initially, skin lesions may not be present in case of HSV 2 encephalitis. Meningococci do not cause encephalitis in new neonates. HSV meningitis or encephalitis is difficult to diagnose by laboratory tests, as there is a low titer of the virus present in the cerebrospinal fluid. Only PCR is sensitive enough to detect HSV DNA in the CSF.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Preparation zack is done to detect giant cell or intra-nuclear inclusions from the scrapings from the base of characteristic lesion and stained with Wright’s or Giemsa stain. sensitivity is low and this can't differentiate between VZV and hsv Option B. HSV meningitis or encephalitis is difficult to diagnose by laboratory tests, as there is a low titer of virus present in the cerebrospinal fluid. Only PCR is sensitive enough to detect HSV DNA in the CSF. HSV infection is confirmed (specific test) by isolation of the virus in tissue culture. Option C. Type-specific antibodies are useful to diagnose primary infection and asymptomatic carriers.</p>\n<p><strong>Extraedge:</strong></p><p>Genital herpes sores The sores usually appear on and around the genitals, anus, buttocks, hips, or thighs. The first thing you may notice is flu-like symptoms: Headache. Fever.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient presented in the neurology clinic with presenile encephalopathy, progressive encephalopathy incoordination, and dementia. He had a history of corneal implant suggestive of human prion disease. Which of the following statement is true?", "options": [{"label": "A", "text": "Prions are protein-free infectious agents with DNA", "correct": false}, {"label": "B", "text": "Resistant to heat, UV rays, and nucleases.", "correct": true}, {"label": "C", "text": "Cause subacute sclerosing pan encephalitis.", "correct": false}, {"label": "D", "text": "Is not fatal in nature", "correct": false}], "correct_answer": "B. Resistant to heat, UV rays, and nucleases.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Resistant to heat, UV rays, and nucleases. Prions are proteinaceous infectious particles without DNA OR RNA that also cause scrapie, Creutzfeldt-Jakob disease, and Kuru disease . They are resistant to heat and radiation. As these particles are only proteins, prions are sensitive to protease but not nucleases. Human prion diseases are slow virus diseases that cause fatal dementia.</p>\n<p><strong>Highyeild:</strong></p><p>Prion diseases, or transmissible spongiform encephalopathies (TSEs), are a family of rare disorders that affect the brains of both humans and animals. The most common prion disease in humans is Creutzfeldt-Jakob Disease (CJD), which affects approximately 1 in a million people worldwide each year.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Prions are infectious particles composed solely of protein with no detectable nucleic acid. Option C. There are several rare neurodegenerative disorders, sometimes referred to as slow virus infections, that are fatal, Some of these infections, such as progressive multifocal leukoencephalopathy (JC polyomavirus) and subacute sclerosing panencephalitis (measles virus), are caused by typical viruses. Option D. Spongiform encephalopathies are a group of chronic, progressive, fatal infections of the CNS caused by unconventional, transmissible agents called prions.</p>\n<p><strong>Extraedge:</strong></p><p>These infectious agents were originally believed to be anomalous viruses, hence their inclusion here. However, they consist solely of protein, with no enclosed nucleic acid. Thus, they are definitely not viruses despite sharing the superficial properties of size and infectiousness.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32-year-old male bitten by a dog was admitted to emergency with a history of hyperactivity and difficulty in swallowing the liquid. The dog died 5 days later and a brain biopsy shows the presence of inclusion bodies. Which of the following inclusion bodies is seen in this case?", "options": [{"label": "A", "text": "Paschen bodies", "correct": false}, {"label": "B", "text": "Torres body", "correct": false}, {"label": "C", "text": "Guarneri bodies", "correct": false}, {"label": "D", "text": "Negri bodies", "correct": true}], "correct_answer": "D. Negri bodies", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Negri bodies</p>\n<p><strong>Highyeild:</strong></p><p>Above case scenario is suggestive Rabies virus infection to dog. Negri bodies are ar seen as intracytoplasmic inclusion bodies, demonstrated from impression smears from brain (Purkinje cells of the cerebellum and pyramidal cells of hippocampus). Negri bodies detection is pathognomonic of rabies but absence does not rule out rabies virus infection. Common Inclusion bodies and the virus producing them: Inclusion bodies Virus Intracytoplasmic Negri bodies Rabies Paschen bodies Variola Guarneri bodies Vaccinia Bollinger bodies Fowlpox Intranuclear Molluscum bodies Molluscum contagiosum Cowdry Type A Yellow fever (Torres bodies) and HSV (Lipschultz bodies) Cowdry Type B Poliovirus and adenovirus Intracytoplasmic + Intranudear Measles and owl's eye appearance in cytomegalovirus</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: -</p>\n<p><strong>Extraedge:</strong></p><p>Negri Bodies Classic histopathologic feature of rabies. They are sharply delineated, eosinophilic inclusions in the neuronal perikarya and proximal dendrites Negri bodies are most common in the hippocampal pyramidal cells, cerebellar Purkinje cells, and brainstem nuclei</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 5 year old boy bitten by a dog presents in emergency with multiple scratches without bleeding. During the observation period, the dog died 5 days later. A dog autopsy was done and samples were collected for diagnosis. Suspected viruses can be isolated from", "options": [{"label": "A", "text": "Cerebrospinal fluid", "correct": false}, {"label": "B", "text": "Salivary gland", "correct": false}, {"label": "C", "text": "Cornea", "correct": false}, {"label": "D", "text": "All of the above", "correct": true}], "correct_answer": "D. All of the above", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above Following being bitten by Dog, the rabies virus multiply locally at the site of inoculation for 48-72 hours and then spread along the peripheral motor nerves to reach CNS via dorsal root ganglia of the spinal cord. From CNS, virus spread to salivary glands along sensory and autonomic nerves followed by the pancreas, kidney and cornea.</p>\n<p><strong>Highyeild:</strong></p><p>Isolation of the virus by tissue culture or Animal inoculation can be done from Brain tissue, CSF, Saliva, and cornea. Corneal smears are the least preferred site for virus isolation, and is no longer recommended</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - All the options are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 5-year-old boy presents in an emergency with multiple scratches the on leg with bleeding. gave a history of being bitten by a stray dog. The emergency medical officer gave immediate post-exposure to the patient and told the parents to observe the dog. The dog died 5 days later. Which of the following is the best test for diagnosis?", "options": [{"label": "A", "text": "Virus isolation by tissue culture", "correct": false}, {"label": "B", "text": "Direct immunofluorescence", "correct": true}, {"label": "C", "text": "Indirect fluorescence assay", "correct": false}, {"label": "D", "text": "Mouse neutralization test", "correct": false}], "correct_answer": "B. Direct immunofluorescence", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Direct immunofluorescence Above case scenario is suggestive of Rabies virus detection. Using skin from nape of the neck or fresh saliva can be subjected to a Direct immunofluorescent antibody (DFA) test using monoclonal antibodies can be performed to detect rabies nucleoprotein antigens in specimens by using specific monoclonal antibodies tagged with fluorescent dye . Because of its high sensitivity and specificity, the DFA test is considered the “gold standard ” method for rabies diagnosis. Sensitivity from the corneal impression is very low, about 30%.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Virus isolation can be done by tissue culture or Mouse inoculation. Negri bodies and rabies antigens can be demonstrated from the brain biopsy of inoculated animals. Option C and D. Indirect fluorescence assay and Mouse neutralization test detect antibodies from CSF by employing antigens like Glycoprotein or nucleoprotein.</p>\n<p><strong>Extraedge:</strong></p><p>Primary, or direct, immunofluorescence uses a single antibody that is chemically linked to a fluorophore. The antibody recognizes the target molecule and binds to it, and the fluorophore it carries can be detected via microscopy.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 45 year female admitted in an emergency with complaint of bizarre behavior, hallucination increased lacrimation and difficulty in swallowing. The patient relatives denied any history of animal bites in the past. What other history, Emergency medical officer should ask to rule out the possibility of Rabies infection in this patient?", "options": [{"label": "A", "text": "Occupational history to rule out inhalation of virus aerosols in Laboratory", "correct": false}, {"label": "B", "text": "History of organ transplant", "correct": false}, {"label": "C", "text": "Both a and b", "correct": true}, {"label": "D", "text": "None of the above", "correct": false}], "correct_answer": "C. Both a and b", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Both a and b Rabies virus can be transmitted to humans by Bite from a rabid dog , Bats, other animals like foxes, raccoons, jackals, etc. Direct contact with saliva of infected animals with mucosa or fresh skin wounds Inhalation of virus-containing aerosols (important for laboratory workers) Cornea or other organ transplantation</p>\n<p><strong>Highyeild:</strong></p><p>Rabies is usually transmitted through an animal bite, for example, from stray dogs. Symptoms include fever, headache, excess salivation, muscle spasms, paralysis and mental confusion. Seek immediate medical attention after a bite or suspected bite. There is no specific treatment for rabies. Once symptoms appear, it's nearly always fatal. A vaccine can prevent infection.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - As all the options are correct.</p>\n<p><strong>Extraedge:</strong></p><p>Rabies lyssavirus has a bullet-like shape with a length of about 180 nm and a cross-sectional diameter of about 75 nm. One end is rounded or conical and the other end is planar or concave. The lipoprotein envelope carries knob-like spikes composed of Glycoprotein G. Spikes do not cover the planar end of the virion (virus particle). Beneath the envelope is the membrane or matrix (M) protein layer which may be invaginated at the planar end. The core of the virion consists of helically arranged ribonucleoprotein</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 10-year-old boy presenting to the pediatric clinic with progressive mental retardation, seizures, and myoclonus. The mother denied the vaccination history of the child. EEG showed periodic sharp wave complexes. Choose the incorrect statement-", "options": [{"label": "A", "text": "It is a sequela of measles infection.", "correct": false}, {"label": "B", "text": "Occurs after a latency period of 1-2 years.", "correct": true}, {"label": "C", "text": "Both grey and white matter of the brain is involved.", "correct": false}, {"label": "D", "text": "Diagnosis is by demonstrating anti-Measles antibodies in the CSF sample.", "correct": false}], "correct_answer": "B. Occurs after a latency period of 1-2 years.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Occurs after a latency period of 1-2 years. SSPE occurs usually after 7-10 years after measles virus recovery.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. It is a late complication of the measles virus affecting oligodendrocytes . Option C. As it is panencephalitis, both grey and white matter are involved. Option D. In a Cerebrospinal fluid (CSF) sample, antibodies can be detected by ELISA, or viral genes can be detected by PCR. Oligoclonal bands can also be seen.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient with multiple sclerosis on treatment presented to the emergency department with seizures, progressive mental deterioration, and visual symptoms. He is currently on steroids, Natalizumab, and interferons for the treatment of multiple sclerosis. The clinician suspected a viral disease and ordered a MRI brain which showed multifocal areas of white matter involvement. Choose the correct option -", "options": [{"label": "A", "text": "It is due to the reactivation of the JC (John Cunningham) virus in astrocytes", "correct": false}, {"label": "B", "text": "The condition is SSPE (Subacute sclerosing panencephalitis)", "correct": false}, {"label": "C", "text": "The brain biopsy shows focal areas of inflammation and demyelination", "correct": true}, {"label": "D", "text": "It is due to steroids in the treatment regime.", "correct": false}], "correct_answer": "C. The brain biopsy shows focal areas of inflammation and demyelination", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>The brain biopsy shows focal areas of inflammation and demyelination Although biopsy is not needed for the diagnosis but biopsy from post-mortem specimens shows areas of demyelination and inflammation in the white matter of the brain.</p>\n<p><strong>Highyeild:</strong></p><p>Progressive multifocal leukoencephalopathy (PML) is a disease of the white matter of the brain, caused by a virus infection (polyomavirus JC) that targets cells that make myelin—the material that insulates nerve cells (neurons).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. It is due to the reactivation of JC virus in oligodendrocytes. Option B. The condition is PML ( progressive multifocal leukoencephalopathy ). Option D. PML is typically associated with NATALIZUMAB use.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 45-year-old male, after receiving a corneal transplant, presents to medicine OPD after 2 years with myoclonus and rapidly progressive dementia. Choose the incorrect statement", "options": [{"label": "A", "text": "It is a case of iatrogenic CJD (Creutzfeldt-Jakob disease)", "correct": false}, {"label": "B", "text": "PrPc accumulation in brain", "correct": true}, {"label": "C", "text": "This leads to the spongiform appearance of brain parenchyma on imaging.", "correct": false}, {"label": "D", "text": "Two familial forms of CJD are Gerstmann-Sträussler - Scheinker syndrome and fatal familial insomnia.", "correct": false}], "correct_answer": "B. PrPc accumulation in brain", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>PrPc accumulation in brain CJD is due to the conversion of PrPc to PrPSc and PrPSc accumulation .</p>\n<p><strong>Highyeild:</strong></p><p>Prion diseases are transmissible, untreatable, and fatal brain diseases of mammals. Their cause is highly unusual: The host's normal prion protein can, for unknown reasons, malfunction and assemble into structured aggregates called prions that cause infectious brain disease</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Iatrogenic CJD has been transmitted accidentally by contaminated growth hormone preparations from human cadaver pituitary glands, by corneal transplant, by contaminated surgical instruments, and by cadaveric human dura mater grafts used for surgical repair of head injury. Option C. The accumulation of vacuoles leads to cortical ballooning or cortical ribboning. Option D. Two familial forms of CJD are Gerstmann-Sträussler-Scheinker syndrome and fatal familial insomnia. These diseases are rare (10–15% of CJD cases) and are due to the inheritance of mutations in the PRP gene.</p>\n<p><strong>Extraedge:</strong></p><p>Spongiform Change in Prion Disease</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 29 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 6 months child presented with diarrhoea and vomiting for three days. Which of the following enterotoxin is most likely responsible for the condition?", "options": [{"label": "A", "text": "NSP4", "correct": true}, {"label": "B", "text": "NSP6", "correct": false}, {"label": "C", "text": "VP3", "correct": false}, {"label": "D", "text": "VP7", "correct": false}], "correct_answer": "A. NSP4", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>NSP4 The rotavirus non-structural protein NSP4 was the first viral enterotoxin discovered. It induces diarrhoea and causes Ca2+-dependent transepithelial secretion.</p>\n<p><strong>Highyeild:</strong></p><p>In Rotavirus NSP4 prevents the development of electrical resistance and lateral targeting of the tight-junction-associated ZO-1 protein. To perform this enterotoxigenic role in vivo, NSP4 is released from infected enterocytes in a soluble form capable of diffusing within the intestinal lumen.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. Gene 11 of rotavirus encodes NSP6, it is a sequence-independent nucleic acid binding protein. Options: C and D. Group A rotaviruses are the most frequent human pathogens. Outer capsid proteins VP4 and VP7 carry epitopes important in neutralizing activity, with VP7 glycoprotein being the pre-dominant antigen. These type-specific antigens differentiate among rotaviruses and are demonstrable by neutralization tests.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "All of the following are true about rotaviral gastroenteritis except:", "options": [{"label": "A", "text": "The name of the causative agent was suggested by its appearance", "correct": false}, {"label": "B", "text": "Most cases of the disease occur in infants and children", "correct": false}, {"label": "C", "text": "Rotavirus belongs to Filoviridae.", "correct": true}, {"label": "D", "text": "The disease is transmitted by the faecal-oral route", "correct": false}], "correct_answer": "C. Rotavirus belongs to Filoviridae.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rotavirus belongs to Filoviridae. ROTAVIRUS: Rotaviruses resemble cartwheels with short spokes radiating from a wide hub to a clearly defined outer rim. The name is derived from rota, which in Latin, means- ing wheel. The complete or 'double-shelled' virus measures about 70 nm in diameter and has a smooth surface. Identified by Bishop and colleagues (1973) in Melbourne, rotaviruses are now recognised as the most common cause of diarrheal disease in infants and children. Divided into six groups (A-F) and 14 serotypes (9 humans, 5 animals) (option A) The commonest cause of gastroenteritis in children below 2 years of age(option B) Infection is transmitted by contaminated water and food(option D) I.P.: 1-2 days, vomiting, diarrhoea, dehydration</p>\n<p><strong>Highyeild:</strong></p><p>Laboratory diagnosis Antigen detection: latex agglutination, passive haemagglutination, ELISA enzyme-linked immunoassay. Detection of virus: electron microscopy, immunoelectron microscopy.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Rotavirus resemble reovirus in term of morphology and strategy of replication Option: B. Rotaviruses cause the major portion of diarrheal illness in infants and children worldwide but not in adults Option: D. Transmission of rotavirus is by the faecal-oral route</p>\n<p><strong>Extraedge:</strong></p><p>table,tr,th,td {border:1px solid black;} Virus Host it infects Capsid Structure Nucleic Acid Type Lambda (λ) phage virus Escherichia coli Prolate i.e. a \"head-tail\" structure (see Fig 2 below) Double-stranded DNA Tobacco mosaic virus Plants Helical Single-stranded RNA Ebola virus Humans Helical Single-stranded RNA Human Immunodeficiency Virus (HIV Humans Fullerene/Cone-shaped Single-stranded RNA</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Lipid envelope is found in which virus:", "options": [{"label": "A", "text": "Reovirus", "correct": false}, {"label": "B", "text": "Herpesvirus", "correct": true}, {"label": "C", "text": "Picornavirus", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "B. Herpesvirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Herpesvirus Herpesvirus is an enveloped virus. The rest of the options are non-enveloped. (options A and C)</p>\n<p><strong>Highyeild:</strong></p><p>DNA viruses which are enveloped : Herpesvirus Poxvirus HBV Hepatitis B Virus. RNA viruses which are enveloped : Coronavirus Bunyavirus Orthomyxovirus Flavivirus Filovirus Arenavirus Paramyxovirus Retrovirus Togavirus Rhabdovirus</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. The virions measure 60–80 nm in diameter and possess two concentric capsid shells, each of which is icosahedral. (Rotaviruses have a triple-layered structure.) There is no envelope. Single-shelled virus particles that lack the outer capsid are 50–60 nm in diameter. The inner core of the particles is 33–40 nm in diameter. The double-shelled particle is the complete infectious form of the virus. Option: C. Picornaviruses represent a very large virus family concerning the number of members but one of the smallest in terms of virion size and genetic complexity. They include two major groups of human pathogens: enteroviruses and rhinoviruses. The virion of enteroviruses and rhinoviruses consists of a capsid shell of 60 subunits, each of four proteins (VP1–VP4) arranged with icosahedral symmetry around a genome made up of a single strand of positive-sense RNA. Parechoviruses are similar except that their capsids contain only three proteins because VP0 does not get cleaved into VP2 and VP4.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis B is transmitted when blood, semen, or another body fluid from a person infected with HBV enters the body of someone who is not infected. This can happen through sexual contact; sharing needles, syringes, or other drug-injection equipment; or from mother to baby at birth.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient comes to the clinic with a complaint of multiple episodes of loose watery stool for 5 days. He gave a history of shellfish consumption at a local restaurant 5 days back and other people who had food from the same restaurant had similar symptoms. This viral gastroenteritis agent has a segmented, double-stranded RNA genome and is Non-enveloped. It is a member of which virus family?", "options": [{"label": "A", "text": "Arenaviridae", "correct": false}, {"label": "B", "text": "Orthomyxoviridae", "correct": false}, {"label": "C", "text": "Reoviridae", "correct": true}, {"label": "D", "text": "Caliciviridae", "correct": false}], "correct_answer": "C. Reoviridae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Reoviridae Icosahedral virions, nonenveloped, segmented genome (10-12 segments), positive-stranded ds RNA</p>\n<p><strong>Highyeild:</strong></p><p>Medically important genera Orthoreovirus: 10 segments Orbivirus: 10 segments Rotavirus: 11 segments Coltivirus: 12 segments COLTIVIRUS: 2 serotypes, Causes Colorado tick fever, Transmitted by ticks Calicivirus- ssRNA; NON-enveloped, unsegmented genome (option D) Arenavirus- ssRNA; enveloped, segmented genome (option A) Reoviridae- ssRNA; NON-enveloped, segmented genome Orthomyxoviridae- ssRNA; enveloped, segmented genome(option B.)</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Arenaviridae is a single-stranded RNA (ssRNA), enveloped and segmented genome Option: B. Orthomyxoviridae is single-stranded RNA (ssRNA), enveloped and segmented Option: D. Calciviridae is single-stranded RNA (ssRNA), non-enveloped and non-segmented</p>\n<p><strong>Extraedge:</strong></p><p>Reovirus. Reoviruses have been associated with upper respiratory infections, enteritis, fever, and febrile exanthema in childhood.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 3-year-old boy presents in Paediatric OPD with complaints of watery diarrhoea, vomiting and fever. The child used to go to a daycare centre from where the same cases were reported two days back. Which of the following is the most common causative agent of gastroenteritis in this child?", "options": [{"label": "A", "text": "Adenovirus", "correct": false}, {"label": "B", "text": "Rotavirus", "correct": true}, {"label": "C", "text": "Norovirus", "correct": false}, {"label": "D", "text": "Sapovirus", "correct": false}], "correct_answer": "B. Rotavirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Rotavirus All of the above-mentioned viruses can cause gastroenteritis.</p>\n<p><strong>Highyeild:</strong></p><p>Rotaviruses are the most common cause of diarrheal illness in infants and children all over the world (option B). Rotaviral diarrhoea is usually seen in children less than 5 years of age, most frequently in the age group 6-24 months. Rotavirus Infections are uncommon in neonates because of maternal Antibodies. Most children have had a clinical or subclinical infection by the age of 5 years, hence rotavirus diarrhoea is uncommon after that age group. Rotavirus has dsRNA genome.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. Adenovirus is the second most common cause of endemic diarrheal illness in infants and young children. Option: C & D. Norovirus and sapovirus belong to the family Calciviridae. Norwalk virus (Norovirus) is the most important cause of epidemic viral gastroenteritis in adults. Sapoviruses cause sporadic cases and occasional outbreaks of diarrheal illness in infants, young children, and the elderly.</p>\n<p><strong>Extraedge:</strong></p><p>Rotavirus is a genus of double-stranded RNA viruses in the family Reoviridae. Rotaviruses are the most common cause of diarrhoeal disease among infants and young children. Nearly every child in the world is infected with a rotavirus at least once by the age of five</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "An outbreak of viral gastroenteritis occurred in a daycare centre. A stool sample was collected for laboratory diagnosis. On Immunoelectron microscopy, the virus gives a cartwheel appearance. Which of the following statement is true about the causative agent?", "options": [{"label": "A", "text": "Virus isolate is a segmented dsDNA virus", "correct": false}, {"label": "B", "text": "Belongs to the family Reoviridae.", "correct": true}, {"label": "C", "text": "Incubation period is 12-18 hours.", "correct": false}, {"label": "D", "text": "Most common serotype in India is 19G.", "correct": false}], "correct_answer": "B. Belongs to the family Reoviridae.", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1687507237004-QTDV024008IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Belongs to the family Reoviridae. Rotaviruses are the most common cause of diarrheal illness in children belonging to the Reoviridae family. The incubation period is about 1–3 days. It has an abrupt onset, characterised by vomiting followed by watery diarrhoea, fever and abdominal pain (option C). It is the only virus family with dsRNA (option A). The most common type seen in the world as well as in India is G1P[8] (option D).</p>\n<p><strong>Highyeild:</strong></p><p>Rotavirus comprises a sharp-edged triple-layered wheel-shaped capsid that looks like spokes around the wheel giving a Cartwheel appearance. Possesses segmented dsRNA, 6 structural proteins and 6 non-structural proteins.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A. It is the only virus family with dsRNA. The most common type seen in the world as well as in India is G1P[8]. Option: C. The incubation period is about 1–3 days. It has an abrupt onset, characterised by vomiting followed by watery diarrhoea, fever and abdominal pain. Option: D. G1 and G2 were found to be the most common serotype of rotavirus in India</p>\n<p><strong>Extraedge:</strong></p><p>The most common symptoms of rotavirus are severe watery diarrhea, vomiting, fever, and/or abdominal pain. Symptoms usually start about two days after a person is exposed to rotavirus. Vomiting and watery diarrhea can last three to eight days.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 3-year-old boy presents in Paediatric OPD with a complaint of watery diarrhoea, vomiting and fever suggestive of viral gastroenteritis which is vaccine-preventable. The vaccination schedule for the same is:", "options": [{"label": "A", "text": "At birth, orally", "correct": false}, {"label": "B", "text": "At birth, subcutaneous", "correct": false}, {"label": "C", "text": "At 6 and 10 weeks, intramuscularly", "correct": false}, {"label": "D", "text": "At 6,10 and 14 weeks, orally", "correct": true}], "correct_answer": "D. At 6,10 and 14 weeks, orally", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>At 6,10 and 14 weeks, orally Rotaviruses are the most common cause of diarrheal illness in children for which two vaccines are available.</p>\n<p><strong>Highyeild:</strong></p><p>What is the rotavirus vaccine schedule? Rotavac™ vaccine is given in a 3-dose schedule at 6, 10 and 14 weeks of age Rotavac™ vaccine can be given at same time as other vaccines in the schedule, such as DTP-HepB-Hib (i.e. Penta1, Penta2 and Penta3) Maintain an interval of 4 weeks between doses, starting 6 weeks</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: A, B and C. Rotavac- live attenuated Rotavirus 116E (g9P[10] strain), three doses At 6,10 and 14 weeks, orally along with DPT and OPV. Provide cross-protection against G1P[8] strain Rotarix- live attenuated G1P[8] strain, two-dose at 6 weeks and 10 week Rota vaccines have been associated with an increased risk of intussusception</p>\n<p><strong>Extraedge:</strong></p><p>Rotavirus can be detected in stool specimens from children with gastroenteritis by several techniques, including electron microscopy, polyacrylamide gel electrophoresis, antigen detection assays, reverse transcription polymerase chain reaction (RT-PCR), and virus isolation</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A Pregnant female presented with acute hepatitis. The serological test is negative for HBs Ag and positive for HEV antibody. What is the route of infection?", "options": [{"label": "A", "text": "Faecal-oral", "correct": true}, {"label": "B", "text": "Sexual transmission", "correct": false}, {"label": "C", "text": "Respiratory transmission", "correct": false}, {"label": "D", "text": "Intravenous route", "correct": false}], "correct_answer": "A. Faecal-oral", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Faecal-oral HEV antibody is suggestive of Hepatitis E infection which is recommended-orally transmitted via sewage contamination of food and water.</p>\n<p><strong>Highyeild:</strong></p><p>Virus Hepatitis A Hepatitis Hepatitis Hepatitis D Hepatitis E Family Picornaviridae Hepadnaviridae Flaviviridae Unclassified Hepeviridae Genus Hepatovirus Orthohepadnavirus Hepacivirus Deltavirus Hepevirus Virion 27 nm, icosahedral 42 nm, spherical 60 nm, spherical 35 nm, spherical 30-32 nm, icosahedral Envelope No Yes (HBsAg) Yes Yes (HBsAg No Genome ssRNA dsDNA ssRNA ssRNA ssRNA Genome size (kb) 7.5 3.2 9.4 1.7 7.2 Stability Heat and acid stable Acid sensitive Ether sensitive, acid sensitive Acid sensitive Heat stable Transmission Fecal-oral Parenteral Parenteral Parenteral Fecal-oral Prevalence High High Moderate Low, regional Regional Fulminant disease Rare Rare Rare Frequent In pregnancy Chronic disease Never Often Often Often Never Oncogenic No Yes Yes Unknown No ds, double stranded; HBsAg, hepatitis B surface antigen; ss, single stranded.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B, C and D. Hepatitis A is also enterically transmitted hepatitis virus. Hepatitis B, C and rarely D are transmitted sexually, intravenously and vertically.</p>\n<p><strong>Extraedge:</strong></p><p>HEV infection usually produces a mild disease, hepatitis E. However, disease symptoms can vary from no apparent symptoms to liver failure. In rare cases, it can prove fatal particularly in pregnant women. Normally, the virus infection will clear by itself.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 18 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A young medical intern named Arvind was in the Paediatric OPD. A 3-year-old child came to the OPD with clinical features of blurred vision and hard of hearing. The child has a history of Recurrent chest infections. On examination, a continuous murmur is noted. The intern couldn't figure out the diagnosis. Which of the following history is expected in this patient which will support the intern to arrive at the diagnosis?", "options": [{"label": "A", "text": "Family history Alport Syndrome", "correct": false}, {"label": "B", "text": "Mother had a Cytomegalovirus infection during the 1st trimester of pregnancy", "correct": false}, {"label": "C", "text": "History of severe vomiting, jaundice and lethargy within the 1st month of life.", "correct": false}, {"label": "D", "text": "Mother has not taken the MMR measles, mumps, and rubella vaccine.", "correct": true}], "correct_answer": "D. Mother has not taken the MMR measles, mumps, and rubella vaccine.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mother has not taken the MMR measles, mumps, and rubella vaccine. Sensorineural Hearing Loss, Congenital Cataracts and Cardiac Defects( PDA and PS) are seen in Congenital Rubella Syndrome . The Patent Ductus Arteriosus (PDA) is associated with a recurrent chest infection( due to increased blood flow to the lungs) and continuous murmur throughout the cardiac cycle. Pulmonary Stenosis can also occur in congenital Rubella Syndrome but it is less common than PDA.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option: A. Alport Syndrome is characterized by Sensorineural Hearing Loss, Congenital Cataracts and Renal involvement ( Nephritic Syndrome). In Alport Syndrome, there is defect a in type 4 collagen. Cardiac defects are not seen. Option: B. Cytomegalovirus infection in 1st trimester of pregnancy can lead to Congenital defects in newborns like visual impairment, Hepatosplenomegaly, Microcephaly and mental abnormalities . CMV virus in adults is most commonly seen in HIV patients with a CD4 T cell count less than 50/ul. Cardiac defects are not seen as Congenital CMV Infections. Option: C . Galactosemia is characterized by jaundice, vomiting, feeding difficulties, congenital cataract and mental retardation. Sensorineural Hearing Loss and Cardiac Defects are not seen in Galactosemia.</p>\n<p><strong>Extraedge:</strong></p><p>The drug of choice for treatment of CMV disease is intravenous ganciclovir, although valganciclovir may be used for nonsevere CMV treatment in selected cases. Ganciclovir is a nucleoside analogue that inhibits DNA synthesis in the same manner as acyclovir.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient with dengue presented with epistaxis and GI bleeding with severe hypotension and circulatory failure. profound shock, unrecordable BP and pulse. The stage of the disease is:", "options": [{"label": "A", "text": "DHF Grade I", "correct": false}, {"label": "B", "text": "DHF Grade II", "correct": false}, {"label": "C", "text": "DHF Grade III", "correct": false}, {"label": "D", "text": "DHF Grade IV", "correct": true}], "correct_answer": "D. DHF Grade IV", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>DHF Grade IV Grading severity of dengue haemorrhagic fever DHF is classified into four grades of severity, where grades III and IV are considered to be DSS. The presence of thrombocytopenia with concurrent haemoconcentration differentiates grades I and II DHF from DF. A larger amount of IV fluid is needed for DHF grade IV, but the rate should be reduced to 10 ml/kg/hr as soon as the blood pressure is restored.</p>\n<p><strong>Highyeild:</strong></p><p>Dengue severity was classified into 4 grades, based on bleeding episodes and shock, as follows: grade 1: no evidence of bleeding, Positive Tourniquet test, grade 2: evidence of bleeding episodes, grade 3: the presence of weak and rapid pulse rate, low blood pressure, or narrow pulse pressure, grade 4: nonmeasurable blood loss. Bleeding complications of dengue Haemorrhagic fever such as epistaxis, and gum presented with complaints of intermittent high-grade fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for All options:- Options A, B & C. Grade 1: no evidence of bleeding, Positive Tourniquet test Grade 2: evidence of bleeding episodes Grade 3: the presence of weak and rapid pulse rate, low blood pressure, or narrow pulse pressure Grade 4: non-measurable blood loss</p>\n<p><strong>Extraedge:</strong></p><p>Dengue (break-bone fever) is a viral infection that spreads from mosquitoes to people. It is more common in tropical and subtropical climates. Most people who get dengue won't have symptoms. But for those that do, the most common symptoms are high fever, headache, body aches, nausea and rash.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "KFD Kyasanur Forest Disease Virus infects:", "options": [{"label": "A", "text": "Dogs", "correct": false}, {"label": "B", "text": "Jackals", "correct": false}, {"label": "C", "text": "Pigs", "correct": false}, {"label": "D", "text": "Monkeys", "correct": true}], "correct_answer": "D. Monkeys", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Monkeys KFD, also referred to as Monkey Fever, is a tick-borne viral haemorrhagic disease, which can be fatal to humans and other primates. The causal agent, Kyasanur Forest Disease Virus (family Flaviviridae, genus Flavivirus), is a member of the tick-borne encephalitis (TBE) complex. Transmission to humans may occur after a tick bite or contact with an infected animal, most importantly a sick or recently dead monkey.</p>\n<p><strong>Highyeild:</strong></p><p>Monkeys are the main amplifying hosts for the KFD virus and they are also sufferers. The surili Presbytis entellus and the bonnet macaque are very susceptible to the KFD virus. They develop tremendous viremia and infect the ticks. The vector for disease transmission is Haemaphysalis spinigera , a forest tick.</p>\n<p><strong>Extraedge:</strong></p><p>Rodents, shrews, and monkeys are common hosts for KFDV after being bitten by an infected tick. KFDV can cause epizootics with high fatality in primates. Transmission to humans may occur after a tick bite or contact with an infected animal, most importantly a sick or recently dead monkey.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Viral Haemorrhagic fever reported in India?", "options": [{"label": "A", "text": "Crimean congo", "correct": true}, {"label": "B", "text": "Yellow fever", "correct": false}, {"label": "C", "text": "Marburg", "correct": false}, {"label": "D", "text": "Ebola", "correct": false}], "correct_answer": "A. Crimean congo", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Crimean congo Reported From Gujrat. Crimean-Congo haemorrhagic fever (CCHF) is a widespread disease caused by a tick-borne virus (Nairovirus) of the Bunyaviridae family. The CCHF virus causes severe viral haemorrhagic fever outbreaks, with a case fatality rate of 10–40%.</p>\n<p><strong>Highyeild:</strong></p><p>Crimean-Congo Haemorrhagic fever (CCHF) is caused by infection with a tick-borne virus (Nairovirus) in the family Bunyaviridae. The disease was first characterized in Crimea in 1944 and given the name Crimean Haemorrhagic fever. Crimean-Congo Haemorrhagic fever (CCHF) is a zoonotic viral disease that is asymptomatic in infected animals, but a serious threat to the health of humans. Human infections begin with non-specific febrile symptoms but progress to a serious haemorrhagic syndrome with a high case fatality rate.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B . Yellow Fever is a mosquito - borne disease mainly found in sub-Saharan Africa and South America. It is preventable by vaccination. Option C. Marburg Virus Disease is a rare but severe Haemorrhagic disease that is known to affect Primates as well as non-primates. The first outbreak was found in Frankfurt, Germany and it hasn’t been reported in India yet. Option D. Ebola virus is mainly found in Sub-Saharan Africa.</p>\n<p><strong>Extraedge:</strong></p><p>Crimean–Congo hemorrhagic fever (CCHF) is a viral disease.[1] Symptoms of CCHF may include fever, muscle pains, headache, vomiting, diarrhea, and bleeding into the skin.[1] Onset of symptoms is less than two weeks following exposure.[1] Complications may include liver failure.[1] In those who survive, recovery generally occurs around two weeks after onset.[</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A neonate was found to have cataracts, deafness and cardiac defects. Which group of viruses does the mother was infected with:", "options": [{"label": "A", "text": "Togaviridae", "correct": true}, {"label": "B", "text": "Flaviviridae", "correct": false}, {"label": "C", "text": "Bunyaviridae", "correct": false}, {"label": "D", "text": "Arenaviridae", "correct": false}], "correct_answer": "A. Togaviridae", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Togaviridae Congenital Rubella syndrome is caused by Rubella which belongs to Togaviridae. Togaviruses (family Togaviridae) are enveloped and icosahedral viruses that possess a positive-sense single-strand RNA genome. Members of this family are frequently referred to as the alphaviruses, a genus of this family. Togavirus, is any of three genera of arthropod-borne viruses (arboviruses) of the family Togaviridae. Togaviruses (family Togaviridae) are enveloped and icosahedral viruses that possess. These include cataracts and retinopathies, heart defects, and neurological defects. The togavirus genome is non-segmented and contains a molecule of linear, it can cause birth defects, mental abnormalities, and deafness.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B: Flaviviridae -include JE virus, DEngue virus, Zika virus,KFD virus. Option D: Arenaviridae-Lassa virus, Machupo virus. Option C: Bunyaviridae is a family of arthropod-borne or rodent-borne, spherical, enveloped RNA viruses.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Infantile pericarditis and myocarditis are most commonly caused by:", "options": [{"label": "A", "text": "Coxsackie A", "correct": false}, {"label": "B", "text": "Coxsackie B", "correct": true}, {"label": "C", "text": "Poliovirus", "correct": false}, {"label": "D", "text": "HPV", "correct": false}], "correct_answer": "B. Coxsackie B", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxsackie B Coxsackie B virus in particular serotypes 1-6 is the most common agent of Myocarditis in children. Coxsackie B infection is characterized by fever, fatigue, malaise and chest pains. Infection of the heart by a coxsackie B virus can lead to viral myocarditis. Viral myocarditis is an inflammatory disease of the heart which can result in heart failure.</p>\n<p><strong>Highyeild:</strong></p><p>Coxsackievirus B is the most common viral culprit of myocarditis . In one study, 34% of patients with myocarditis and idiopathic dilated cardiomyopathy had enteroviral RNA present. Myocarditis is a common cause of dilated cardiomyopathy. The most common causes of infectious myocarditis are viruses. Th e exact mechanism of coxsackievirus B-induced damage to myocytes is unknown. The likely mechanisms involve immune-mediated and direct viral cytotoxicity. A number of other viral, bacterial, and fungal infections as well as medications have also been shown to cause myocarditis and pericarditis.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A . Coxsackie A causes Herpangina (vesicular pharyngitis), hand-foot-and-mouth disease and acute haemorrhagic conjunctivitis. Option C. Poliovirus causes Poliomyelitis in children and can be prevented by vaccination Option D . Adenovirus causes common cold or flu-like symptoms, fever, sore throat, pneumonia, pink eye etc.</p>\n<p><strong>Extraedge:</strong></p><p>Coxsackieviruses are a few related enteroviruses that belong to the Picornaviridae family of nonenveloped, linear, positive-sense single-stranded RNA viruses, as well as its genus Enterovirus, which also includes poliovirus and echovirus. Enteroviruses are among the most common and important human pathogens, and ordinarily its members are transmitted by the fecal–oral route. Coxsackieviruses share many characteristics with poliovirus. With control of poliovirus infections in much of the world, more attention has been focused on understanding the nonpolio enteroviruses such as coxsackievirus.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 16 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "7-year-old boy is brought to the emergency department due to fever, headache, vomiting, and confusion. He has no prior medical conditions and is up to date with immunizations. The patient has not traveled recently, and his parents report no exposure to individuals with similar symptoms or ingestion of anything out of the ordinary. They have recently noticed several dead birds around their neighborhood. The temperature is 39 C (102.2 F). Physical examination shows neck rigidity and right lower extremity weakness with fasciculation. Cerebrospinal fluid analysis shows a leukocyte count of 200/mm3 with 20% neutrophils and 80% lymphocytes. Which of the following is the most likely pathogen responsible for this patient's condition?", "options": [{"label": "A", "text": "West Nile virus", "correct": true}, {"label": "B", "text": "Cryptococcus neoformans", "correct": false}, {"label": "C", "text": "Hemophilus influenza", "correct": false}, {"label": "D", "text": "Nonpolio enterovirus", "correct": false}], "correct_answer": "A. West Nile virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>West Nile virus West Nile virus is an enveloped RNA virus that is found in warm climates worldwide. The virus replicates extensively within birds and is passed to mosquitos (Culex species) during blood feeding. Viral accumulation in mosquito salivary glands can lead to human transmission.</p>\n<p><strong>Highyeild:</strong></p><p>Most infected patients develop low-level viremia that is neutralized within a week by the humeral immune response; these individuals typically remain asymptomatic. However, a minority of patients (particularly the young, elderly, or immunosuppressed) are unable to mount an effective immune response and develop significant clinical manifestations, including: West Nile fever - a self-limited, flu-like illness that is often associated with a maculopapular rash Neuroinvasive disease - the virus is neurotropic and often causes meningitis (eg, fever, headache, neck stiffness), encephalitis (eg, confusion, tremors, seizures), and/or flaccid paralysis (eg, asymmetric weakness of limbs, fasciculations). Cerebrospinal fluid usually shows a lymphocytic pleocytosis. Most patients recover completely with supportive care, but some with neuro-invasive disease have long-term neurologic sequelae or die.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option B. Cryptococcus neoformans, a fungus found in bird feces, can cause meningoencephalitis . However, most cases occur in those with severe immunosuppression (eg, advanced AIDS). Option C. Hemophilus influenzae and Streptococcus pneumoniae are leading causes of acute bacterial meningitis , which is often associated with fever, headache, vomiting, and neck stiffness. However, cerebrospinal fluid usually shows a high neutrophil count. In addition, lower-motor neuron signs such as fasciculations would be atypical. Option D. Nonpolio enteroviruses (eg, Coxsackievirus, echovirus) often cause aseptic (viral) meningitis and can occasionally cause encephalitis. However, these viruses are not associated with bird vectors and do not typically cause lower-motor neuron signs.</p>\n<p><strong>Extraedge:</strong></p><p>West Nile virus is a single-stranded RNA virus that causes West Nile fever. It is a member of the family Flaviviridae, from the genus Flavivirus, which also contains the Zika virus, dengue virus, and yellow fever virus. The virus is primarily transmitted by mosquitoes, mostly species of Culex.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Two weeks after birth, a neonate develops sepsis, skin vesicles, and conjunctivitis. Over the next several days, the baby's condition deteriorates with the development of seizures, cranial nerve palsies, and lethargy. The baby dies approximately one week after onset of symptoms. Which infectious agent would most likely cause this clinical presentation?", "options": [{"label": "A", "text": "Cytomegalovirus", "correct": false}, {"label": "B", "text": "Herpes simplex", "correct": true}, {"label": "C", "text": "Rubella", "correct": false}, {"label": "D", "text": "N.gonorrhoea", "correct": false}], "correct_answer": "B. Herpes simplex", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Herpes simplex There are two types of HSV: HSV type 1 usually causes small blisters on the mouth, eye, or lips (cold sores) and HSV type 2 usually affects the genital area. HSV infection in newborn babies can be very severe and can even cause death. This is because newborns' immune systems are not fully developed.</p>\n<p><strong>Highyeild:</strong></p><p>Neonatal herpes simplex virus (HSV) infection has high mortality and significant morbidity. In infants with CNS disease, mortality is usually caused by a devastating brain. Unfortunately, there is no consistent set of signs and symptoms with which babies with neonatal HSV disease present.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. Cytomegalic inclusion disease of newborns is characterized by the involvement of the central nervous system and the reticuloendothelial system . Clinical features include intrauterine growth retardation, jaundice, hepatosplenomegaly, thrombocytopenia, microcephaly, and retinitis. Mortality rates are about 20%. Congenital infection may result in the death of the fetus in utero Option C. The classic triad of congenital rubella consists of cataracts, cardiac abnormalities, and deafness . Infants may also display transient symptoms of growth retardation, rash, hepatosplenomegaly, jaundice, and meningoencephalitis. Option D. A pregnant woman with syphilis can transmit T pallidum to the fetus through the placenta beginning in the 10th–15th weeks of gestation. Some of the infected fetuses die, and miscarriages result; others are stillborn at term. Others are born in life but develop the signs of congenital syphilis in childhood, including interstitial keratitis, Hutchinson’s teeth, saddle-nose, periostitis, and a variety of central nervous system anomalies. Adequate treatment of the mother during pregnancy prevents congenital syphilis.</p>\n<p><strong>Extraedge:</strong></p><p>Herpes sores usually appear as one or more blisters on or around the genitals, rectum or mouth. This is known as having an “outbreak”. The blisters break and leave painful sores that may take a week or more to heal. Flu-like symptoms (e.g., fever, body aches, or swollen glands) also may occur during the first outbreak</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "The most sensitive test for the diagnosis of herpes simplex (HSV) meningitis in a newborn infant is?", "options": [{"label": "A", "text": "Cerebrospinal fluid (CSF) protein analysis", "correct": false}, {"label": "B", "text": "HSV culture", "correct": false}, {"label": "C", "text": "HSV IgG antibody", "correct": false}, {"label": "D", "text": "HSV polymerase chain reaction", "correct": true}], "correct_answer": "D. HSV polymerase chain reaction", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>HSV polymerase chain reaction PCR finds the genetic material (DNA) of the HSV herpes simplex virus virus. This test can tell the difference between HSV-1 and HSV-2. Using the PCR test on skin sores isn't common. PCR is used mainly for testing spinal fluid in rare cases when herpes may have caused an infection in or around the brain. Antibody tests.</p>\n<p><strong>Highyeild:</strong></p><p>Testing HSV herpes simplex virus DNA on blood samples by PCR has recently been shown to be beneficial for laboratory diagnosis of neonatal infection. Rapid diagnosis by viral culture or HSV PCR is essential. The most common site of retrieval is skin vesicles. The nasopharynx, eyes, rectum, blood, and cerebrospinal fluid should also be tested. In some neonates with encephalitis, the virus is present only in the CNS Central Nervous System.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Options A & B. Virus isolation remains the definitive diagnostic approach. The virus may be isolated from herpetic lesions and may also be found in throat washings, cerebrospinal fluid, and stool, both during primary infection and during asymptomatic periods. Therefore, the isolation of HSV is not in itself sufficient evidence to indicate that the virus is the cause. Option C. Antibodies appear in 4–7 days after infection and reach a peak in 2–4 weeks. They persist with minor fluctuations for the life of the host. Detection methods available include neutralization, immunofluorescence, and enzyme-linked immunosorbent assay. The diagnostic value of serologic assays is limited by the multiple antigens shared by HSV-1 and HSV-2. There may also be some heterotypic anamnestic responses to varicella-zoster virus in persons infected with HSV and vice versa.</p>\n<p><strong>Extraedge:</strong></p><p>The classic presentation of HSV encephalitis is of a fever, headache, altered consciousness, focal neurological signs and seizures. Intravenous aciclovir is an effective treatment, reducing mortality and morbidity.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following is an incorrect statement regarding meningitis-", "options": [{"label": "A", "text": "Group B streptococcus is the most common agent implicated in neonates", "correct": false}, {"label": "B", "text": "S.pneumoniae is the most common agent in adult and elderly", "correct": false}, {"label": "C", "text": "Varicella virus causes mollarets meningitis.", "correct": true}, {"label": "D", "text": "Cryptococcus is the most common fungal agent.", "correct": false}], "correct_answer": "C. Varicella virus causes mollarets meningitis.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Varicella virus causes mollarets meningitis. HSV meningitis, which is usually seen in association with primary genital HSV infection, is an acute, self-limited disease manifested by headache, fever, and mild photophobia and lasting 2–7 days. Lymphocytic pleocytosis in the CSF is characteristic. Neurologic sequelae of HSV meningitis are rare. HSV is the most commonly identified cause of recurrent lymphocytic meningitis (Mollaret’s meningitis).</p>\n<p><strong>Highyeild:</strong></p><p>Inflammation of brain and spinal cord membranes, typically caused by an infection. Meningitis is usually caused by a viral infection but can also be bacterial or fungal. Vaccines can prevent some forms of meningitis. Symptoms include headache, fever and stiff neck. Depending on the cause, meningitis may get better on its own or it can be life-threatening, requiring urgent antibiotic treatment.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Rest options are self-explanatory.</p>\n<p><strong>Extraedge:</strong></p><p>Type of meningitis Glucose Protein Cells Acute bacterial low high PMNs, often > 300/mm³ Acute viral normal normal or high mononuclear, < 300/mm³ Tuberculous low high mononuclear and PMNs, < 300/mm³ Fungal low high < 300/mm³ Malignant low high usually mononuclear</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Which of the following enteroviruses family has been named to hepatitis A virus.?", "options": [{"label": "A", "text": "Entero virus 72", "correct": true}, {"label": "B", "text": "Entero virus 70", "correct": false}, {"label": "C", "text": "Entero virus 71", "correct": false}, {"label": "D", "text": "Coxsackie A virus group", "correct": false}], "correct_answer": "A. Entero virus 72", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Entero virus 72</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option: B. 70 causes hand foot and mouth disease. Option: C. 71 causes herpangina. Option: D. Causes herpangina, Acute hemorrhagic conjunctivitis, Hand foot mouth disease.</p>\n<p><strong>Extraedge:</strong></p><p>Hepatitis A is preventable by vaccine. It spreads from contaminated food or water or contact with someone who is infected. Symptoms include fatigue, nausea, abdominal pain, loss of appetite and low-grade fever. The condition clears up on its own in one or two months. Rest and adequate hydration can help.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 14-year-old boy presented with headache, photophobia, vomiting, and neck rigidity in the emergency. On examination, bilateral parotid glands were enlarged and tender. CSF examination shows leukocytosis with predominant lymphocytes, slightly raised protein, and normal glucose level. Which of the following is the most likely causative agent?", "options": [{"label": "A", "text": "Streptococcus pneumoniae", "correct": false}, {"label": "B", "text": "Mumps", "correct": true}, {"label": "C", "text": "Enterovirus", "correct": false}, {"label": "D", "text": "Mycobacterium tuberculosis", "correct": false}], "correct_answer": "B. Mumps", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Mumps In viral meningitis, CSF leucocytosis with predominant lymphocytes occurs with slightly increased CSF protein and usually normal CSF glucose level. Enterovirus is the most common cause of viral meningitis.</p>\n<p><strong>Highyeild:</strong></p><p>Parotitis with painful parotid enlargement is usually the first sign of Mumps infection . As the above case history is suggestive of viral meningitis with parotitis, the Most likely causative agent is the MUMPS virus.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. In Pneumococcal meningitis , CSF leucocytosis with predominant neutrophils occurs with increased CSF protein and markedly reduced CSF glucose level. Option C. Enterovirus accounts for the majority of cases of Aseptic meningitis but parotitis is not common symptoms of enterovirus infection Option D. Mycobacterium tuberculosis can also cause meningitis and CSF analysis shows marked leucocytosis with predominant lymphocytosis along with increased CSF protein and decreased CSF glucose level.</p>\n<p><strong>Extraedge:</strong></p><p>Mumps affects the parotid glands, salivary glands below and in front of the ears. The disease spreads through infected saliva. Some people experience no symptoms. When symptoms occur, they include swollen, painful salivary glands, fever, headache, fatigue and appetite loss. Treatment focuses on symptom relief. Recovery takes about two weeks. The disease can be prevented by the MMR vaccine.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 14-year-old boy presented with headache, photophobia, vomiting, and neck rigidity in the emergency. On examination, bilateral parotid glands were enlarged and tender. CSF examination shows leukocytosis with predominant lymphocytes, slightly raised protein, and normal glucose level suggestive of viral meningitis. The Virology lab reported an enveloped ssRNA virus infection in the boy suggestive of Mumps. Which of the following statements is incorrect?", "options": [{"label": "A", "text": "Transmission is through the respiratory route.", "correct": false}, {"label": "B", "text": ">50% of cases of Mumps can have Aseptic meningitis", "correct": true}, {"label": "C", "text": "occur predominantly in males", "correct": false}, {"label": "D", "text": "Absence of parotitis does not rule out Mumps meningitis.", "correct": false}], "correct_answer": "B. >50% of cases of Mumps can have Aseptic meningitis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>>50% of cases of Mumps can have Aseptic meningitis Aseptic meningitis occurs in < 10% of Mumps infected cases. It is usually a self-limiting condition and resolves without any sequelae.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. mumps is transmitted via a respiratory route t hrough saliva, droplets, or with contact with infected fomites. Option C. Children are the most commonly affected age group with male predominance. Option D. Parotitis with painful parotid enlargement is usually the first sign of Mumps infection. However, the involvement of extraperitoneal sites like CNS may sometimes occur in the absence of parotitis.</p>\n<p><strong>Extraedge:</strong></p><p>Mumps | Paramyxovirus Acute, self-limited viral syndrome Low-grade fever, malaise, headache, myalgias, anorexia 48 hrs later, followed by Complications Orchitis (epididymoorchitis)- most common in adult males Oophoritis-post-pubertal Aseptic meningitis - most common extrasalivary complication Encephalis .Deafness Pancreatis Complications Orchitis (epididymoorchitis)- most common in adult males Oophoritis-post-pubertal Aseptic meningitis - most common extrasalivary complication Encephalis .Deafness Pancreatis</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 15-year-old girl presented with signs and symptoms suggestive of meningitis. She had a history of fever, malaise, headache, and sore throat for a few days. CSF examination revealed increased white blood cells with predominant lymphocytes, protein 1g/L, and CSF: Blood glucose ratio normal. Which of the following is the likely diagnosis A non-enveloped ssRNA virus is isolated from PCR amplification. Which of the following is the most probable causative agent?", "options": [{"label": "A", "text": "Herpes simplex virus", "correct": false}, {"label": "B", "text": "West Nile virus", "correct": false}, {"label": "C", "text": "Mumps", "correct": false}, {"label": "D", "text": "Poliovirus", "correct": true}], "correct_answer": "D. Poliovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Poliovirus</p>\n<p><strong>Highyeild:</strong></p><p>Poliovirus, the causative agent of polio, is a serotype of the species Enterovirus C, in the family of Picornaviridae. There are three poliovirus serotypes: types 1, 2, and 3. Poliovirus is composed of an RNA genome and a protein capsid.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - From the above options, only Poliovirus is a non enveloped ssRNA virus. Herpes simplex virus (OPTION A) Enveloped West Nile virus (OPTION B) ssRNA Enveloped Polio virus (OPTION D) ssRNA Non-Enveloped Mumps (OPTION C) ssRNA Enveloped</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 15-year-old girl presented with signs and symptoms suggestive of meningitis. She had a history of fever, malaise, headache, and sore throat for a few days. CSF examination revealed increased white blood cells with predominant lymphocytes, protein 1g/L, and CSF: Blood glucose ratio normal. Which of the following is the likely diagnosis An ssRNA virus is isolated from PCR amplification. suggestive of Poliovirus. Which of the following statement is not true about the poliovirus?", "options": [{"label": "A", "text": "Poliovirus is a non-enveloped ssRNA virus.", "correct": false}, {"label": "B", "text": "Causes ascending flaccid paralysis", "correct": true}, {"label": "C", "text": "Virus entry is mediated by the CD155 receptor on the host cell", "correct": false}, {"label": "D", "text": "Is a vaccine-preventable infection", "correct": false}], "correct_answer": "B. Causes ascending flaccid paralysis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Causes ascending flaccid paralysis Poliovirus belongs to the Picornaviridae family, having positive sense ssRNA, and is non-enveloped. The earliest manifestations are fever, headache, sore throat, and malaise. Sometimes the disease progresses and leads to aseptic meningitis.</p>\n<p><strong>Highyeild:</strong></p><p>Clinical Features of Poliomyelitis Acute onset, flaccid paralysis Fever present at onset No progression after 2-3 days Asymmetric Legs affected most often Mortality rate 5-10% Paralysis is permanent Aseptic meningitis & non-paralytic illness</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. If the infection progresses, it can cause descending acute asymmetric flaccid paralysis. Option C. Viral entry into the host cells is mediated by binding t o CD155 receptors present on the host cell surface. Option D. Both inactivated (Injectable) and live attenuated (oral) polio vaccines are available for Poliovirus.</p>\n<p><strong>Extraedge:</strong></p><p>Poliovirus infects human cells by binding to an immunoglobulin-like receptor, CD155 (also known as the poliovirus receptor or PVR) [12][13] on the cell surface. [14] Interaction of poliovirus and CD155 facilitates an irreversible conformational change of the viral particle necessary for viral entry. [15][16] Following attachment to the host cell membrane, entry of the viral nucleic acid was thought to occur one of two ways: via the formation of a pore in the plasma membrane through which the RNA is then “injected” into the host cell cytoplasm, or via virus uptake by receptor-mediated endocytosis. [17] Recent experimental evidence supports the latter hypothesis and suggests that poliovirus binds to CD155 and is taken up by endocytosis. Immediately after internalization of the particle, the viral RNA is released</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 32 year old female presents to the hospital emergency department with complaints of low-grade fever, night sweats, malaise, and neck rigidity. A lumbar puncture was done and a CSF sample was collected in a sterile container, which was sent to the Microbiology department for diagnosis. Biochemical analysis of CSF - Total leukocyte count: 20/mm3, predominant lymphocytes CSF Glucose: 45mg/dL CSF protein: 50 mg/dL Which of the following is the most likely diagnosis?", "options": [{"label": "A", "text": "Pneumococcal meningitis", "correct": false}, {"label": "B", "text": "Mycobacterium tuberculosis", "correct": false}, {"label": "C", "text": "Enterovirus", "correct": true}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "C. Enterovirus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Enterovirus In viral meningitis, CSF leucocytosis with predominant lymphocytes occurs with slightly increased CSF protein and usually normal CSF glucose levels. Enterovirus is the most common cause of viral meningitis.</p>\n<p><strong>Highyeild:</strong></p><p>Characteristics Normal Pyogenic Meningitis Tuberculous Meningitis Viral meningitis TLC (/mm³) 0-5 100-10000 10-500 25-500 Predominant cell type Lymphocytes Neutrophils Lymphocyte Lymphocyte Glucose (mg/dL) 40-70 <40 20-40 Normal Total proteins (mg/dL) 15-45 >45 100-500 20-80</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options: - Option A. In Pneumococcal meningitis , CSF leucocytosis with predominant neutrophils occurs with increased CSF protein and markedly reduced CSF glucose level. Option B. Mycobacterium tuberculosis can also cause meningitis and CSF analysis shows marked leucocytosis with predominant lymphocytosis occurs with increased CSF protein and decreased CSF glucose level. Option D. Above CSF picture is suggestive of Viral meningitis.</p>\n<p><strong>Extraedge:</strong></p><p>Although meningitis affects all ages, young children are most at risk. Newborn babies are at most risk from Group B streptococcus, young children are at higher risk from meningococcus, pneumococcus and Haemophilus influenzae.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 20 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Likely cause the manifestations (image) in a three year old child would be?", "options": [{"label": "A", "text": "Coxsackie", "correct": true}, {"label": "B", "text": "Pox virus", "correct": false}, {"label": "C", "text": "Varicella zoster", "correct": false}, {"label": "D", "text": "Herpes simplex", "correct": false}], "correct_answer": "A. Coxsackie", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689248593846-QTDV058001IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Coxsackie HFMD -Hand foot and mouth disease, caused by coxsackieviruses , usually causes fever, malaise, skin rash, sore throat, and small blisters that ulcerate. The most frequent locations for the blisters/ulcers are on the palms of the hand, soles of the feet, and in the mouth. Coxsackieviruses are part of the enterovirus family of viruses (which also includes polioviruses and hepatitis A virus).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Poxviruses are brick or oval-shaped viruses with large double-stranded DNA genomes. Poxviruses exist throughout the world and cause disease in humans and many other types of animals. Poxvirus infections typically result in the formation of lesions, skin nodules, or disseminated rash. Option C. Varicella (chickenpox) is an acute infectious disease. It is caused by the varicella-zoster virus (VZV), which is a DNA virus that is a member of the herpesvirus group. After the primary infection, VZV stays in the body (in the sensory nerve ganglia) as a latent infection. Primary infection with VZV causes varicella. Option D. The herpes simplex virus, also known as HSV, is a viral infection that causes genital and oral herpes. Many people live with asymptomatic HSV. Options D , B and C. These are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "42-year-old diabetic man from Kerala presented with symptoms of upper respiratory tract infection. He had a history of exposure to a patient diagnosed with Enveloped RNA virus infection which possesses hemagglutinin and neuraminidase peplomers. Which of the following statements is not true?", "options": [{"label": "A", "text": "Peplomers project spikes on the surface of the envelope.", "correct": false}, {"label": "B", "text": "Peplomers are non-antigenic", "correct": true}, {"label": "C", "text": "Some viruses have more than one peplomers", "correct": false}, {"label": "D", "text": "Peplomers are virus coded.", "correct": false}], "correct_answer": "B. Peplomers are non-antigenic", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Peplomers are non-antigenic The envelope of the virus contains the lipid part and protein part. The protein part is made of subunits called peplomers which are virus coded while the lipid part is from the host cell membrane. Peplomers are antigenic in nature . Some viruses may have more than one peplomer like the influenza virus which has hemagglutinin and neuraminidase peplomers, point mutations of these peplomers results in an Antigenic Drift.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options:- Option A. Peplomers project as spikes on the surface of the envelope. - True Option C. Some viruses have more than one peplomers - True Option D. Peplomers are virus coded. - True Options A, D and C. These are the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "42-year-old diabetic man presented with symptoms of upper respiratory tract infection. He had a history of exposure to a patient diagnosed with Enveloped segmented RNA virus infection which possesses hemagglutinin and neuraminidase peplomers. The most probable causative agent is?", "options": [{"label": "A", "text": "Respiratory syncytial virus", "correct": false}, {"label": "B", "text": "Coronavirus", "correct": false}, {"label": "C", "text": "Influenza virus", "correct": true}, {"label": "D", "text": "Parainfluenza virus", "correct": false}], "correct_answer": "C. Influenza virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Influenza virus The influenza virus belongs to the Orthomyxoviridae family which contains segmented RNA ( 8 pieces) and enveloped. Influenza viruses have hemagglutinin and neuraminidase peplomers, point mutations of these peplomers result in Antigenic Drift.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, B and D. Coronavirus, parainfluenza virus and RSV are enveloped RNA viruses but have an unsegmented genome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old boy from an orphanage presents with complaints of high-grade fever, chills, headache and dry cough. In history, other children in the orphanage also have similar complaints. Virus isolation is shown in the picture. Identify the causative virus:", "options": [{"label": "A", "text": "Influenza A", "correct": true}, {"label": "B", "text": "Influenza C", "correct": false}, {"label": "C", "text": "Parainfluenza", "correct": false}, {"label": "D", "text": "Respiratory Syncytial virus", "correct": false}], "correct_answer": "A. Influenza A", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689248609728-QTDV058004IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Influenza A The above-shown virus in the diagram is suggestive of enveloped, negative sense ssRNA virus with 8 segments.</p>\n<p><strong>Highyeild:</strong></p><p>The influenza virus is spherical in shape surrounded by helical nucleocapsids. It is an ssRNA virus with multiple segments. Influenza A and B- 8 RNA segments Influenza C and D- 7 RNA segments Also, it contains 8 structural proteins and 2 non-structural proteins. Structural proteins PB1, PB2, and PA - polymerase proteins responsible for RNA transcription and replication Nucleoprotein (NP)- capsid protein, associated with viral RNA to form a ribonucleoprotein (RNP) or nucleocapsid with a helical symmetry Matrix proteins:- M1 protein is the major viral protein. It forms a shell (protein layer) underneath the envelope. M2 proteins form ion channels in the envelope, help in the transport of molecules Non-structural proteins: NS1 is an interferon antagonist and inhibits pre-mRNA splicing. NS2 helps in the export of molecules across the nucleus Hemagglutinin (HA) and neuraminidase (NA) are the glycoproteins inserted into the lipid envelope.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C and D. Coronavirus, parainfluenza virus and RSV are enveloped RNA viruses but have an unsegmented genome.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 6-year-old boy presents with complaints of high-grade fever, chills, headache and dry cough. In history, other children in the orphanage also have similar complaints. Virus isolation is shown in the picture. What is the most common route of Infection?", "options": [{"label": "A", "text": "FecoOral transmission", "correct": false}, {"label": "B", "text": "Droplets transmission", "correct": true}, {"label": "C", "text": "Airborne transmission", "correct": false}, {"label": "D", "text": "Intravenous transmission", "correct": false}], "correct_answer": "B. Droplets transmission", "question_images": ["https://dbmi-data.s3.ap-south-1.amazonaws.com/photos-1689248610220-QTDV058005IMG1.JPG"], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Droplets transmission The above-shown virus in the diagram is suggestive of Influenza virus infection- having ssRNA, 8 segments of the It is transmitted by: Droplets transmission- generated by coughing/sneezing</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. The faecal-oral route describes a particular route of transmission of a disease wherein pathogens in faecal particles pass from one person to another. Eg Picornavirus (polio) Option D. Rarely happens in a community setting - except for Intravenous drug abusers (HIV, HBV, HCV) Option C. Airborne transmission - Coronavirus, measles.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A pandemic that occurred in the year 2009 due to a suspected virus-causing illness in this patient has the property of Antigenic Variation. Which of the following statements is correct regarding Antigenic Variation?", "options": [{"label": "A", "text": "Antigenic variation occurs due to changes in HA (Hemagglutinin) peplomers only.", "correct": false}, {"label": "B", "text": "Antigenic shift is the result of a point mutation in genes.", "correct": false}, {"label": "C", "text": "Antigenic shift is seen only in the Influenza A virus.", "correct": true}, {"label": "D", "text": "Antigenic shift results in endemics.", "correct": false}], "correct_answer": "C. Antigenic shift is seen only in the Influenza A virus.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Antigenic shift is seen only in the Influenza A virus. Influenza viruses have the unique property of Antigenic variations as a result of antigenic changes in HA (HEmagglutinin) and NA (Neuraminidase) peplomers. It is of 2 types: Antigenic drift- due to point mutation in HA/NA gene . Seen in both Influenza A and B and results in outbreaks and minor epidemics, occur every 2-3 years Antigenic Shift- occurs due to genetic reassortment between genomes of two or more influenza viruses infecting the same host cells, Occurs only in Influenza A, results in pandemics and major epidemics occur every 10-20 years .</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. This is a wrong statement, variation occurs due to a change in HA or NA or both. Option B. Antigenic drift is the result of a point mutation in genes. Option D. Antigenic shift is the larger magnitude change and it results in epidemics.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 42-year-old male was admitted to the emergency with a complaint of high-grade fever and cough. On examination, the patient's oxygen saturation was less than 60% and intubation was done. The medical officer is suspecting Influenza virus infection and sent nasopharyngeal swabs for PCR which were positive for Influenza B. Which of the following inhalational antiviral drug can be given to this patient?", "options": [{"label": "A", "text": "Oseltamivir", "correct": false}, {"label": "B", "text": "Zanamivir", "correct": true}, {"label": "C", "text": "Amantadine", "correct": false}, {"label": "D", "text": "Rimantadine", "correct": false}], "correct_answer": "B. Zanamivir", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Zanamivir Antiviral therapy for Influenza should be started within 48 hours of the onset of symptoms. Options A and B. Neuraminidase inhibitors (such as zanamivir- Inhalational form, oseltamivir- orally) can be administered for influenza A and influenza B infections. It is the drug of choice for A/H1N1 2009 flu, A/H5N1 avian flu and influenza-B Matrix protein M2 inhibitor: Amantadine and Rimantadine can be given for some strains of influenza A infection. However, strains of A/H1N1 2009 flu and A/H5N1 avian flu and influenza B virus have developed resistance. The other options can be given via inhalational route (Options A, C and D).</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Arboviral disease is a general term used to describe infections caused by a group of viruses spread to people by the bite of infected arthropods (insects) such as mosquitoes and ticks. These infections usually occur during warm weather months, when mosquitoes and ticks are active. Which of the following arbovirus has a vertical transmission?", "options": [{"label": "A", "text": "Zika Virus", "correct": true}, {"label": "B", "text": "Cmv Virus", "correct": false}, {"label": "C", "text": "Chikungunya", "correct": false}, {"label": "D", "text": "Rubella", "correct": false}], "correct_answer": "A. Zika Virus", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Zika Virus</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C and D. CMV and rubella virus are not Arbovirus and Chikungunya spread by Aedes mosquito but are not congenital infections. Zika virus can be transmitted by Aedes mosquito, sexual routes and from mother to child. It can result in microcephaly/ congenital Zika</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 18 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "A 23-year-old pregnant female visited antenatal clinical in the 10th week of pregnancy with a complaint of fever and rash. On examination, she had petechiae spots over the palate. She was counselled for congenital infection in the baby. Which of the following is the most common congenital symptom that the baby can have?", "options": [{"label": "A", "text": "Salt and pepper retinopathy", "correct": false}, {"label": "B", "text": "Sensorineural hearing loss", "correct": false}, {"label": "C", "text": "Patent ductus arteriosus", "correct": false}, {"label": "D", "text": "All of the above.", "correct": true}], "correct_answer": "D. All of the above.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>All of the above. Congenital rubella presents as a classical triad of sensorineural hearing loss, salt and pepper retinopathy and patent ductus arteriosus. Other features are microcephaly, mental retardation and autism.</p>\n<p><strong>Highyeild:</strong></p><p>Congenital rubella Congenital rubella— can be catastrophic in early pregnancy, leading to fetal death, premature delivery, and many congenital defects. Rare since the introduction of vaccination. The younger the fetus when infected the more severe the illness. In the first 2 months of gestation, there is an up to 85% chance of being affected by either multiple defects or abortion. third month – 30% chance of developing a single defect (e.g. deafness) 10% in the fourth month and nil after 20 weeks. Temporary defects include low birthweight, low platelets, hepatosplenomegaly, hepatitis, meningitis, and jaundice. Permanent defects include hearing loss, cardiac abnormalities, microcephaly, inguinal hernia, cataract, and glaucoma. Developmental defects may become apparent as the infant grows, e.g. myopia, mental retardation, diabetes, and behavioural and language disorders.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "In view of an epidemic of Influenza, Government advised vaccination of all healthcare staff and High-risk individuals of more than 60 years of age. Which of the following statements is not correct about the influenza vaccine?", "options": [{"label": "A", "text": "2 doses are required in healthcare workers IM >=4 weeks apart.", "correct": true}, {"label": "B", "text": "Comprises of three strains- A/H1N1, A/H3N2 and influenza B strain", "correct": false}, {"label": "C", "text": "Vaccine Immunity lasts for 6-12 months", "correct": false}, {"label": "D", "text": "Vaccine composition is reviewed every year.", "correct": false}], "correct_answer": "A. 2 doses are required in healthcare workers IM >=4 weeks apart.", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>2 doses are required in healthcare workers IM >=4 weeks apart.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option D. Based on WHO recommendations, influenza vaccines are prepared and reviewed every year. This is due to the antigenic drifts in the influenza virus. Influenza vaccines are available in a cocktail of either three strains or four strains Option B. Trivalent form: Comprises of three strains: A/H1N1, A/H3N2 and influenza B strain Quadrivalent form: Comprise of four strains: A/H1N1, A/H3N2 and two lineages of influenza B strain. A single dose is to be administered by intramuscular (IM) The vaccine efficacy varies from 25–67% (25% for H3N2, 42% against type B and 67% against H1N1). Option C. Immunity after the vaccine lasts for 6-12 months. Options B, C and D. Are correct regarding influenza vaccination.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 12-year-old boy from a village in Uttar Pradesh presented with signs and symptoms of encephalitis. Similar cases were notified from the same area in the last week. Blood samples were collected from children below 15 years of age and sent to the virology lab for diagnosis. All of the following is true except:", "options": [{"label": "A", "text": "Culex Vishnui mosquito is a vector", "correct": false}, {"label": "B", "text": "No vaccine is available for the disease", "correct": true}, {"label": "C", "text": "Incubation period is 5-15 days", "correct": false}, {"label": "D", "text": "Infective virus shows iceberg phenomenon", "correct": false}], "correct_answer": "B. No vaccine is available for the disease", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>No vaccine is available for the disease This question is discussing Japanese encephalitis which is the most common cause of encephalitis in India and is endemic in Uttar Pradesh.</p>\n<p><strong>Random:</strong></p><p>Explanation for other options:- Option A. Culex tritaeniorhynchus and Culex vishnui, mosquitoes that breed in rice fields are the principal vectors. Option C. Incubation period to develop an infection is 5-15 days. Live attenuated vaccine is available with strain SA 14-14-2 which is included in the National immunization programme in India in endemic districts. It is given subcutaneously. Option D. Iceberg phenomenon is visible in encephalitis.</p>\n<p><strong>Extraedge:</strong></p><p>Transmission of Je Virus: It is extremely common in Uttar Pradesh due to extensive paddy/ rice farming which is a great breeding ground for culex mosquitoes. Also, UP is a state with many piggeries and pigs are a great amplifying host for this virus. Options A, C and D. Are correct.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 23-year-old male from Delhi complained of severe retro-orbital pain along with biphasic fever. A blood examination showed a platelet count of 76000 and the tourniquet test was positive. What is the most probable diagnosis?", "options": [{"label": "A", "text": "Chikungunya", "correct": false}, {"label": "B", "text": "Dengue", "correct": true}, {"label": "C", "text": "Japanese encephalitis", "correct": false}, {"label": "D", "text": "Yellow fever", "correct": false}], "correct_answer": "B. Dengue", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dengue The most probable diagnosis is Dengue virus infection. Dengue fever is characterized by high-grade fever with pain all over the body more at the retro-orbital/ frontal region and maculopapular rash . Myalgia and thrombocytopenia are common in Dengue. Delhi is infamous for seasonal dengue bouts as it harbours many Aedes mosquitoes as the state offers many artificial breeding grounds due to extreme construction work year-round.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. While Chikungunya is mostly presented with fever with arthritis. Thrombocytopenia and retroorbital pain is rare in Chikungunya. Option D. Yellow fever is not present in India. Option C. Patients with Japanese encephalitis present with symptoms of encephalitis. It is more common in Uttar Pradesh.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 55-year-old male complained of petechial rashes and severe body pain for the last 3 days. Blood examination showed a platelet count of 89000. What lab test is to be done for diagnosis?", "options": [{"label": "A", "text": "NS1 Antigen", "correct": true}, {"label": "B", "text": "Antibody detection", "correct": false}, {"label": "C", "text": "Low Platelet count", "correct": false}, {"label": "D", "text": "Tourniquet test", "correct": false}], "correct_answer": "A. NS1 Antigen", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>NS1 Antigen NS1 Antigen is detectable from day 1 and highly specific while antibody appears after 5 days of fever.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C & D. Low Platelet count and Tourniquet test are not specific tests. The national vector-borne disease control program (NVBDCP) suggests testing for NS1 antigen for 1st five days of the symptoms and then antibody testing (IgM) after 5 days by ELISA.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A family from Dengue endemic area in India visit a doctor and asked for prophylaxis for the same. In history, one of the family members already had a dengue virus infection previously once. The doctor didn’t give the prophylactic vaccine to any of the family members because:", "options": [{"label": "A", "text": "There is no role for vaccines.", "correct": false}, {"label": "B", "text": "Vaccine is helpful only for patients who don't have a previous history of dengue", "correct": false}, {"label": "C", "text": "Vaccine is not licensed in India", "correct": true}, {"label": "D", "text": "Vaccine is given only to those who already had a previous infection", "correct": false}], "correct_answer": "C. Vaccine is not licensed in India", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Vaccine is not licensed in India The dengue vaccine is given only to those who already had a previous infection but is not available in India because of its safety issues. In this scenario, one family member had a history of Dengue infection previously and is eligible for the vaccine but due to non-availability in INDIA vaccination could not be done.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A & B. Dengvaxia is being tried in those who have had a previous infection. Option D. Vaccine is given only to those who already had a previous infection - this is not correct Options A, B & D. Are incorrect options.</p>\n<p><strong>Extraedge:</strong></p><p>Antibody-dependent enhancement (ADE) It is known that antibodies to dengue viruses at sub-neutralizing concentrations enhance dengue virus infection of Fc gamma R+ cells. This phenomenon called antibody-dependent enhancement (ADE) occurs when virus-antibody complexes bind to the Fc gamma R via the Fc portion of the Ig. As the dengue virus has many serotypes, the previous infection with one serotype can cause catastrophic consequences if the patient is infected with another serotype due to the sub-optimal neutralization of the new serotype virus by the previous serotype antibodies. This is an important phenomenon with dengue vaccines. Therefore these vaccines are used only in extremely endemic countries where the pros of the vaccine outweigh the cons.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Dengue is a viral infection transmitted to humans through the bite of infected mosquitoes. The primary vectors that transmit the disease are Aedes aegypti mosquitoes and, to a lesser extent, Ae. albopictus. The virus responsible for causing dengue is called dengue virus (DENV). Which strain is used for the Dengue virus vaccine?", "options": [{"label": "A", "text": "SA 14-14-2", "correct": false}, {"label": "B", "text": "17D", "correct": false}, {"label": "C", "text": "CYD-TDV", "correct": true}, {"label": "D", "text": "RA 27/3", "correct": false}], "correct_answer": "C. CYD-TDV", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>CYD-TDV CYD-TDV —- Dengue vaccine</p>\n<p><strong>Highyeild:</strong></p><p>Other important VACCINE strains EV76-Plague Nakayama and Beijing strain- Japanese encephalitis (not used now). Jeryl Lynn strain- MUMPS Danish 1331- BCG for Tuberculosis Schwartz strain (most common), Edmonton- Zagreb strain, Moraten strain- Measles Oka strain- Varicella-Zoster Options A, B and D. Are incorrect options.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. SA 14-14-2 - —Japanese encephalitis vaccine Option B. 17D —- yellow fever vaccine Option D. RA 27/3 —- Rubella vaccine</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A tourist from Central America was travelling to India. He was asked to show a vaccine certificate at the airport. For which of the viral infection vaccine certificates was asked?", "options": [{"label": "A", "text": "Kyasanur forest disease", "correct": false}, {"label": "B", "text": "Japanese encephalitis", "correct": false}, {"label": "C", "text": "Rubella", "correct": false}, {"label": "D", "text": "Yellow fever", "correct": true}], "correct_answer": "D. Yellow fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Yellow fever Yellow fever is not present in India, other options (infections) are endemic in India. Hence strict vigilance on vaccination and quarantine is enforced to prevent the establishment of disease in INDIA. The vaccine is given to all Indians too, leaving the country going to YF endemic regions (Africa) The vaccine is considered effective after 10 days of vaccination for a period of 10 years. Yellow fever is mainly confined to Central and South America and Africa.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. Japanese encephalitis virus is endemic in Tamil Naidu, Andhra Pradesh and Uttar Pradesh. Option A. Kyasanur forest disease was found in the Kyasanur forest in the Shimoga district of Karnataka. Option C. Rubella is worldwide in distribution. Options A, B and C. These are incorrect options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A tourist from Central America was travelling to India. He was asked to show a vaccine certificate at the airport. A vaccine certificate was not available. He will be quarantined for:", "options": [{"label": "A", "text": "6 days", "correct": true}, {"label": "B", "text": "10 days", "correct": false}, {"label": "C", "text": "15 days", "correct": false}, {"label": "D", "text": "No need of quarantine", "correct": false}], "correct_answer": "A. 6 days", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>6 days Yellow fever is not present in India, others are endemic in India. Hence strict vigilance on vaccination and quarantine is enforced to prevent the establishment of disease in INDIA. The incubation period of yellow fever is 6 days. During quarantine, they will be monitored for symptoms like jaundice, renal failure All passengers coming to India or passengers going from India to countries endemic for Yellow Fever should have a valid International Vaccination Card for Yellow Fever or they will be quarantined for a period of 6 days or till the YF vaccination becomes valid (whichever is earlier).</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options C, B and D. Are incorrect options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A newborn baby was having microcephaly and myelitis. It was found that the mother had GBS During Pregnancy. What is the most probable diagnosis?", "options": [{"label": "A", "text": "Toxoplasmosis", "correct": false}, {"label": "B", "text": "ZIKA Virus infection", "correct": true}, {"label": "C", "text": "CMV Virus infection", "correct": false}, {"label": "D", "text": "Rubella", "correct": false}], "correct_answer": "B. ZIKA Virus infection", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>ZIKA Virus infection Zika virus can be transmitted from mother to baby and microcephaly is a common clinical feature in babies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A patient present in medicine OPD with acute onset of fever and severe joint pain. The patient had leukopenia with normal platelet count and hematocrit value. Dengue RNA PCR was negative. Which of the following tests will help in diagnosis?", "options": [{"label": "A", "text": "Chikungunya RNA PCR", "correct": true}, {"label": "B", "text": "Plaque reduction and neutralization test", "correct": false}, {"label": "C", "text": "IgM antibody detection for dengue", "correct": false}, {"label": "D", "text": "IgM antibody detection for Chikungunya.", "correct": false}], "correct_answer": "A. Chikungunya RNA PCR", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Chikungunya RNA PCR The history in the question suggests arboviral infection. Dengue is ruled out; the next diagnosis is chikungunya. PCR is a specific test for early diagnosis. Antibodies appear later in infection with dengue and chikungunya.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option B. PCR FOR chikungunya RNA can help in early diagnosis and is more specific than antibody detection. Option C. PRNT is most often used in research settings. Ab detection has lower sensitivity than PCR. So, Options C, B and D. Are incorrect options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A newborn baby had a petechiae rash all over the body at birth. On asking the mother, she complained of petechiae over the soft palate suggestive of Forchhemier spots at the 32nd week of pregnancy and was advised TORCH test. She was not vaccinated with the MMR vaccine. What is the diagnosis for a newborn?", "options": [{"label": "A", "text": "Blueberry muffin syndrome", "correct": false}, {"label": "B", "text": "Congenital Rubella syndrome", "correct": true}, {"label": "C", "text": "Congenital CMV infection", "correct": false}, {"label": "D", "text": "Congenital Toxoplasmosis", "correct": false}], "correct_answer": "B. Congenital Rubella syndrome", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Congenital Rubella syndrome Forchheimer Spots are seen in Rubella infection in the 3rd trimester. The lack of MMR vaccines also points towards Rubella infection. Newborn with petechiae all over the body is called a Blueberry muffin rash .</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 65-year-old was admitted to an emergency with intra-abdominal bleeding, high-grade fever and thrombocytopenia. He had a previous history of fever with rash. Medical officers in emergency diagnosed it as an Antibody-dependent enhancement which is seen in:", "options": [{"label": "A", "text": "Yellow fever", "correct": false}, {"label": "B", "text": "Japanese encephalitis", "correct": false}, {"label": "C", "text": "Chikungunya fever", "correct": false}, {"label": "D", "text": "Dengue haemorrhagic fever", "correct": true}], "correct_answer": "D. Dengue haemorrhagic fever", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Dengue haemorrhagic fever On secondary infection of the dengue virus, the exaggerated immune response can be seen due to antibody-dependent enhancement resulting in more tissue damage and virus replication. This is a known phenomenon with dengue virus secondary infection. This causes Dengue haemorrhagic fever and dengue shock syndrome.</p>\n<p><strong>Highyeild:</strong></p><p>It is known that antibodies to dengue viruses at sub-neutralizing concentrations enhance dengue virus infection of Fc gamma R+ cells. This phenomenon called antibody-dependent enhancement (ADE) occurs when virus-antibody complexes bind to the Fc gamma R via the Fc portion of the Ig. As the dengue virus has many serotypes, the previous infection with one serotype can cause catastrophic consequences if the patient is infected with another serotype due to the sub-optimal neutralization of the new serotype virus by the previous serotype antibodies. This is ALSO an important phenomenon with dengue vaccines. Therefore these vaccines are used only in extremely endemic countries where the pros of the vaccine outweigh the cons.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 23 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">
Instructions
Test Features:
Multiple choice questions with single correct answers
Timer-based testing for realistic exam conditions
Mark questions for review functionality
Comprehensive results and performance analysis
Mobile-optimized interface for learning on-the-go
Start Test
<!-- Quiz Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="quiz"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <!-- Progress Bar --> <div class="w-full bg-gray-200 rounded-full h-3 mb-4"> <div class="progress-bar h-3 rounded-full" id="progress-bar" style="width: 0%"></div> </div> <!-- Question Header --> <div class="flex flex-col md:flex-row justify-between items-center mb-4"> <h2 class="text-lg font-semibold" id="question-number">Question <span>1</span> of 4</h2> <p class="text-lg font-semibold mt-2 md:mt-0" id="timer">Time Remaining: <span>00:00</span></p> </div> <!-- Question Content --> <div class="mb-6" id="question-content"> <p class="text-gray-800 mb-4" id="question-text"></p> <div class="flex flex-wrap gap-4 mb-4" id="question-images"></div> <div class="space-y-3" id="options"></div> </div> <!-- Navigation Buttons --> <div class="flex flex-col md:flex-row justify-between items-center gap-2 md:gap-4"> <div class="flex gap-2 w-full md:w-auto"> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="previous-btn">Previous</button> <button class="bg-[#2c5281] text-white px-4 py-3 w-full md:w-32 h-14 rounded-lg hover:bg-[#2c5281] transition" id="next-btn">Next</button> </div> <div class="flex items-center gap-2"> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="mark-review"> Review <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path d="M10 2a1 1 0 00-1 1v14l3.293-3.293a1 1 0 011.414 0L17 17V3a1 1 0 00-1-1H10z" /> </svg> </button> <button class="bg-transparent text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100 transition flex items-center gap-1" id="nav-toggle"> Question 🧭 </button> <button class="bg-green-500 text-white px-6 py-3 w-44 h-14 rounded-lg hover:bg-green-600 transition w-full md:w-auto" id="submit-test">Submit Test</button> </div> </div> </section> <!-- Results Section --> <section class="container mx-auto px-4 md:px-6 pt-4 md:pt-6 pb-1 hidden section-transition" id="results"> <div class="bg-white rounded-lg shadow-md p-4 md:p-6"> <h2 class="text-2xl font-semibold mb-4">Anaesthesia Machine - Results</h2> <div class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6"> <p><strong>Correct:</strong> <span id="correct-count" class="text-[#000000]">0</span></p> <p><strong>Wrong:</strong> <span id="wrong-count" class="text-[#000000]">0</span></p> <p><strong>Unanswered:</strong> <span id="unanswered-count" class="text-[#000000]-500">0</span></p> <p><strong>Marked for Review:</strong> <span id="marked-count" class="text-[#000000]">0</span></p> </div> <h3 class="text-lg font-semibold mb-4" id="result-question-number">Question <span>1</span> of 4</h3> <div class="space-y-6" id="results-content"></div> <div class="result-nav"> <button aria-label="Previous question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" disabled="" id="prev-result">Previous</button> <button aria-label="Toggle results navigation panel" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="results-nav-toggle">Result 🧭</button> <button aria-label="Next question result" class="result-nav-btn bg-[#2c5281] text-white px-6 py-2 rounded-lg hover:bg-[#2c5281] transition" id="next-result">Next</button> </div> <div class="mt-6 flex space-x-4 button-group md:flex-row flex-col"> <button class="bg-green-500 text-white px-6 py-2 rounded-lg hover:bg-green-600 transition" id="take-again">Take Again</button> </div> </div> </section> <!-- Exit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="exit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Leave Test?</h2> <p class="text-gray-700 mb-4">Your progress will be lost if you leave this page. Are you sure you want to exit?</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="continue-test">No, Continue</button> <button class="bg-red-500 text-white px-4 py-2 rounded-lg hover:bg-red-600 transition" id="exit-test">Yes, Exit</button> </div> </div> </div> <!-- Submit Confirmation Modal --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 hidden" id="submit-modal" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white rounded-lg p-6 max-w-sm w-full"> <h2 class="text-xl font-semibold mb-4">Confirm Submission</h2> <p class="text-gray-700 mb-2">You have attempted <span id="attempted-count">0</span> of 4 questions.</p> <p class="text-gray-700 mb-4"><span id="unattempted-count">0</span> questions are unattempted.</p> <div class="flex justify-end space-x-4"> <button class="bg-gray-300 text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-400 transition" id="cancel-submit">Cancel</button> <button class="text-white px-4 py-2 rounded-lg hover:bg-[#1a365d] transition" style="background-color: #2c5281;" id="confirm-submit">Submit Test</button> </div> </div> </div> <!-- Quiz Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 nav-panel hidden overflow-y-auto" id="nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Questions Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-nav">Close</button> </div> </div> <!-- Results Navigation Panel --> <div class="fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center p-4 z-50 results-nav-panel hidden overflow-y-auto" id="results-nav-panel" style="align-items: flex-start; padding-top: 33vh;"> <div class="bg-white shadow-lg p-4 rounded-lg w-full max-w-2xl max-h-[80vh] overflow-y-auto"> <h2 class="text-lg font-semibold mb-4">Results Navigation</h2> <div class="mb-4"> <select class="w-full p-2 border rounded-lg text-gray-700" id="results-nav-filter"> <option value="all">All Questions</option> <option value="answered">Answered</option> <option value="unanswered">Unanswered</option> <option value="marked">Marked for Review</option> </select> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> </div> <div class="grid grid-cols-5 gap-2 md:gap-3" id="results-nav-grid"></div> <button class="mt-4 bg-gray-500 text-white px-4 py-2 rounded-lg hover:bg-gray-600 transition w-full" id="close-results-nav">Close</button> </div> <!-- JavaScript Logic --> <script> // Enable debug mode for detailed logging const DEBUG_MODE = true; // Log debug messages function debugLog(message) { if (DEBUG_MODE) { console.log(`[DEBUG] ${message}`); } } // Initialize questions with error handling let questions = []; let currentResultQuestion = 0; // State for current question in results try { debugLog("Attempting to parse questions_json"); questions = [{"text": "Mercury drop colonies on Bordet Gengou medium are seen in:", "options": [{"label": "A", "text": "Haemophilus influenzae", "correct": false}, {"label": "B", "text": "Bordetella pertussis", "correct": true}, {"label": "C", "text": "Yersinia pestis", "correct": false}, {"label": "D", "text": "Bacillus anthracis", "correct": false}], "correct_answer": "B. Bordetella pertussis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bordetella pertussis Mercury drop colonies on BG agar are characteristic of B. pertussis. Culture of B. pertussis: Microbiological culture— requires special media (e.g. Regan– Lowe or Bordet– Gengou agar ). Specimens – flexible swab or deep NPA during the catarrhal or early paroxysmal phase. Culture for 7 days. Usually negative in those previously immunized or given antibiotics.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options A, C and D Are incorrect influenzae shows Satellitism Anthracis has medusa head appearance colonies.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Polysaccharide capsules are structures found on the cell surface of a broad range of bacterial species. The polysaccharide capsule often constitutes the outermost layer of the cell, and therefore is often involved in mediating direct interactions between the bacteria and its environment. The polysaccharide capsule of the following bacteria has a role in their infectivity except:", "options": [{"label": "A", "text": "Haemophilus influenza", "correct": false}, {"label": "B", "text": "Neisseria meningitides", "correct": false}, {"label": "C", "text": "Streptococcus pneumoniae", "correct": false}, {"label": "D", "text": "Bordetella pertussis", "correct": true}], "correct_answer": "D. Bordetella pertussis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bordetella pertussis Bordetella pertussis is a Gram-negative, aerobic, pathogenic, encapsulated coccobacillus of the genus Bordetella, and the causative agent of pertussis or whooping cough. Whooping cough is caused by a type of bacteria called Bordetella pertussis. When an infected person coughs or sneezes, tiny germ-laden droplets are sprayed into the air and breathed into the lungs of anyone who happens to be nearby. Polysaccharide (PS) capsules are important virulence determinants for many bacterial pathogens. Bordetella pertussis, the agent of whooping cough, produces a surface-associated microcapsule but its role in pertussis pathogenesis remains unknown.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option C. Streptococcus pneumoniae Klebsiella pneumoniae Option A. Haemophilus influenzae Pseudomonas aeruginosa Option B. Neisseria meningitidis Cryptococcus neoformans So, Options A, B and C. These are the correct</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A 2 yr old child is brought by parents with a history of cough with a characteristic inspiratory whoop. The child is not immunized. Which of the following would be the best method of diagnosis?", "options": [{"label": "A", "text": "“Cough plate” culture", "correct": false}, {"label": "B", "text": "Oral swab", "correct": false}, {"label": "C", "text": "Nasopharyngeal swab", "correct": true}, {"label": "D", "text": "Tracheobronchial aspirate", "correct": false}], "correct_answer": "C. Nasopharyngeal swab", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Nasopharyngeal swab Regan and Lowe, in developing a medium for use in the transport of whooping cough specimens, discovered an enrichment medium useful for the selective isolation of B. pertussis and B. parapertussis. Test of whooping cough, from nasopharyngeal swabs and other sources of pharyngeal exudate. Remel Regan-Lowe Semisolid Transport Medium is recommended for use and should have a nasopharyngeal (NP) aspirate and/or NP swab obtained for culture. Similarly, Bordet–Gengou agar is used as a selective media for this bacteria It is best for you to obtain a culture from nasopharyngeal (NP) specimens collected during the first 2 weeks of cough.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. was earlier considered as a specimen of interest but with respect to infection control practices, the cough-plate method is no more an appropriate choice. Option B. Oral swab doesn't contain a good load of bacteria. Option D. Tracheobronchial aspirate is an invasive sample and not preferred to nasopharyngeal swab So, Options A, B and D. Are not the correct options.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pertussis is also known as whooping cough. It is a highly infectious bacterial disease involving the respiratory tract. It is caused by a bacterium (Bordetella pertussis or Bordetella parapertussis ) that is found in the mouth, nose and throat of an infected person. True regarding pertussis:", "options": [{"label": "A", "text": "95% of vaccinated are protected", "correct": false}, {"label": "B", "text": "Erythromycin should be given to contacts", "correct": true}, {"label": "C", "text": "Neuroparalytic complications are seen in 1 in 15000", "correct": false}, {"label": "D", "text": "Leukocytosis is diagnostic", "correct": false}], "correct_answer": "B. Erythromycin should be given to contacts", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Erythromycin should be given to contacts Erythromycin, a macrolide antibiotic, has been the antimicrobial of choice for treatment or postexposure prophylaxis of pertussis. It is usually administered in 4 divided daily doses for 14 days. Chemoprophylaxis of pertussis: Consider treating close contacts of pertussis cases (including children and staff at day centres) who are particularly vulnerable, unvaccinated, partially vaccinated, or under 5 years of age.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Pertussis vaccine is a vaccine that protects against whooping cough (pertussis). There are two main types: whole-cell vaccines and acellular vaccines. The whole-cell vaccine is about 78% effective while the acellular vaccine is 71–85% effective. Option C. The most common complication of pertussis is bacterial pneumonia. Rare complications include seizures, inflammation of the brain, and death. Option D. Leucocytosis is diagnostic - this is incorrect as it is not a specific sign.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pertussis vaccine is a vaccine that protects against whooping cough. There are two main types: whole-cell vaccines and acellular vaccines. The whole-cell vaccine is about 78% effective while the acellular vaccine is 71–85% effective. Acellular pertussis vaccine contains:", "options": [{"label": "A", "text": "Pertactin, fimbrial hemagglutinin, cytotoxin, endotoxin", "correct": false}, {"label": "B", "text": "Pertactin, fimbrial hemagglutinin, fimbriae, pertussis toxin", "correct": true}, {"label": "C", "text": "Pertactin, cytotoxin, fimbriae, pertactin", "correct": false}, {"label": "D", "text": "Cytotoxin, fimbrial hemagglutinin, pertussis toxin", "correct": false}], "correct_answer": "B. Pertactin, fimbrial hemagglutinin, fimbriae, pertussis toxin", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Pertactin, fimbrial hemagglutinin, fimbriae, pertussis toxin Acellular pertussis vaccines contain inactivated pertussis toxin (PT) and may contain one or more other bacterial components e.g., filamentous hemagglutinin {FHA}, a 69-kilodalton outer-membrane protein -- Pertactin {Pn}, and fimbriae. It is a vaccine that contains cellular material but not complete cells, specifically, antigenic or allergenic parts of cells. So Option A, D & C are not the correct options.</p>\n<p><strong>Highyeild:</strong></p><p>DPT Schedule: 3 doses are administered in the 1 year at 6-10-14 weeks of age, 1 booster in the 2 years at 16-18 months and 2 boosters at 4-6 years. They are administered as age-appropriate combination vaccines with Hepatitis B, Hib, and IPV. Adolescents should also receive one dose of Tdap vaccine at 10-12 years of age. Td is recommended every 10 years thereafter. Pregnant women should receive 1 dose of Tdap (Td vaccine as a second alternative), between 27-36 weeks of pregnancy, during every pregnancy. Td vaccine is also used for tetanus prophylaxis after skin breaching injuries/trauma.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "A zoonotic disease is a disease or infection that can be transmitted naturally from vertebrate animals to humans. All of the following cause zoonotic infections except?", "options": [{"label": "A", "text": "Bacillus anthracis", "correct": false}, {"label": "B", "text": "Brucella melitensis", "correct": false}, {"label": "C", "text": "Bordetella pertussis", "correct": true}, {"label": "D", "text": "Francisella tularensis", "correct": false}], "correct_answer": "C. Bordetella pertussis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Bordetella pertussis Zoonosis: a disease that can be transmitted from animals to people or, more specifically, a disease that normally exists in animals but that can infect humans. There are multitudes of zoonotic diseases.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A. Some examples include anthrax. ascariasis. Option B. Brucellosis is one of the most widespread zoonoses transmitted by animals and in endemic areas, human brucellosis has serious public health consequences.29-Jul-2020 Option D. Tularemia, also known as “rabbit fever,” is a disease caused by the bacterium Francisella tularensis. Tularemia is typically found in animals, especially rodents, rabbits, and hares. A number of parasitic zoonoses such as cryptosporidiosis, toxoplasmosis and leishmaniasis have gained in importance as human pathogens due to their ability to cause disease in patients with immune suppression due to HIV. So, Options A, B and D. All cause zoonotic infections.</p>\n<p><strong>Extraedge:</strong></p><p>Bacterioses/rickettsioses Viroses Parasitoses Anthrax Avian influenza (highly pathogenic) Cryptosporidiosis Bovine tuberculosis Hantaviruses Giardiasis Brucellosis Hepatitis E Leishmaniasis Campylobacteriosis Japanese encephalitis Lymphatic filariasis (B. malayi) Leptospirosis Nipah virus (infection due to) Schistosomiasis Plague Rabies Taeniasis/cysticercosis Q fever Toxoplasmosis Salmonellosis Trematodiases Streptococcus suis (infection due to) Trichinellosis Scrub typhus</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "Pertussis toxin is produced by which of the following?", "options": [{"label": "A", "text": "B. pertussis", "correct": true}, {"label": "B", "text": "B. parapertussis", "correct": false}, {"label": "C", "text": "B. bronchiseptica", "correct": false}, {"label": "D", "text": "All of the above", "correct": false}], "correct_answer": "A. B. pertussis", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>B. pertussis The above 3 species can cause whooping cough in humans. B. parapertussis and B. bronchiseptica cause milder disease.</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Options B, C. The gene for the pertussis toxin is present in all 3 species but expressed only in B. pertussis.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}, {"text": "DTaP vaccine — protects against whooping cough, diphtheria, and tetanus (for infants and children) Tdap vaccine — protects against whooping cough, diphtheria, and tetanus (for preteens, teens, and adults). Pertussis toxin acts by all except-", "options": [{"label": "A", "text": "ADP ribosylation of proteins associated with receptors", "correct": false}, {"label": "B", "text": "Increase in cAMP", "correct": false}, {"label": "C", "text": "Increased Calcium release from the sarcoplasmic reticulum", "correct": true}, {"label": "D", "text": "A is an active subunit and binds through the B subunit", "correct": false}], "correct_answer": "C. Increased Calcium release from the sarcoplasmic reticulum", "question_images": [], "explanation_images": [], "explanation": "<p><strong>Solution:</strong></p><p>Increased Calcium release from the sarcoplasmic reticulum PT is not associated with increased Calcium release from the sarcoplasmic reticulum</p>\n<p><strong>Random:</strong></p><p>Explanation for incorrect options:- Option A, B. Pertussis toxin causes ADP ribosylation of G proteins associated with receptors which activate adenylyl cyclase, leading to increased concentration of cAMP. This cAMP is responsible for various biological effects. Option D. Pertussis toxin is a 105 kDa protein composed of six subunits: S1 (A subunit) and B subunit consisting of S2, S3, (2)S4, and S5. A is an active subunit and binds through B.</p>\n<p>@dams_new_robot</p>", "bot": "@dams_new_robot", "video": ""}]; if (!Array.isArray(questions) || questions.length === 0) { throw new Error("Questions data is empty or invalid"); } debugLog(`Successfully parsed ${questions.length} questions`); } catch (e) { console.error("Failed to parse questions_json:", e); document.getElementById('error-message').innerHTML = "Error loading quiz data. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; // Fallback to sample questions for testing questions = [ { text: "What is 2 + 2?", options: [ { label: "A", text: "3", correct: false }, { label: "B", text: "4", correct: true }, { label: "C", text: "5", correct: false }, { label: "D", text: "6", correct: false } ], correct_answer: "B. 4", question_images: [], explanation_images: [], explanation: "<p>2 + 2 = 4</p><p>@dams_new_robot</p>", bot: "@dams_new_robot", audio: "", video: "" } ]; debugLog("Loaded fallback questions"); } // Quiz state let currentQuestion = 0; let answers = new Array(questions.length).fill(null); let markedForReview = new Array(questions.length).fill(false); let timeRemaining = 18 * 60; // Duration in seconds let timerInterval = null; const quizId = `{title.replace(/\s+/g, '_').toLowerCase()}`; // Unique ID for local storage // Load saved progress function loadProgress() { try { debugLog("Loading progress from localStorage"); const saved = localStorage.getItem(`quiz_${quizId}`); if (saved) { const { savedAnswers, savedMarked, savedTime } = JSON.parse(saved); answers = savedAnswers || answers; markedForReview = savedMarked || markedForReview; timeRemaining = savedTime !== undefined ? savedTime : timeRemaining; debugLog("Progress loaded successfully"); } else { debugLog("No saved progress found"); } } catch (e) { console.error("Error loading progress:", e); debugLog("Failed to load progress: " + e.message); } } // Save progress function saveProgress() { try { debugLog("Saving progress to localStorage"); localStorage.setItem(`quiz_${quizId}`, JSON.stringify({ savedAnswers: answers, savedMarked: markedForReview, savedTime: timeRemaining })); debugLog("Progress saved successfully"); } catch (e) { console.error("Error saving progress:", e); debugLog("Failed to save progress: " + e.message); } } // Initialize quiz function initQuiz() { try { debugLog("Initializing quiz"); loadProgress(); const startButton = document.getElementById('start-test'); if (!startButton) { throw new Error("Start test button not found"); } startButton.addEventListener('click', startQuiz); debugLog("Start test button listener attached"); document.getElementById('previous-btn').addEventListener('click', showPreviousQuestion); document.getElementById('next-btn').addEventListener('click', showNextQuestion); document.getElementById('mark-review').addEventListener('click', toggleMarkForReview); document.getElementById('nav-toggle').addEventListener('click', toggleNavPanel); document.getElementById('submit-test').addEventListener('click', showSubmitModal); document.getElementById('continue-test').addEventListener('click', closeExitModal); document.getElementById('exit-test').addEventListener('click', () => { debugLog("Exiting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('cancel-submit').addEventListener('click', closeSubmitModal); document.getElementById('confirm-submit').addEventListener('click', submitTest); document.getElementById('take-again').addEventListener('click', () => { debugLog("Restarting test"); localStorage.removeItem(`quiz_${quizId}`); window.location.reload(); }); document.getElementById('close-nav').addEventListener('click', toggleNavPanel); document.getElementById('nav-filter').addEventListener('change', updateNavPanel); document.getElementById('prev-result').addEventListener('click', showPreviousResult); document.getElementById('next-result').addEventListener('click', showNextResult); document.getElementById('results-nav-toggle').addEventListener('click', toggleResultsNavPanel); document.getElementById('close-results-nav').addEventListener('click', toggleResultsNavPanel); document.getElementById('results-nav-filter').addEventListener('change', updateResultsNavPanel); debugLog("Quiz initialized successfully"); } catch (e) { console.error("Failed to initialize quiz:", e); debugLog("Failed to initialize quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('start-test').disabled = true; } } // Start quiz function startQuiz() { try { debugLog("Starting quiz"); document.getElementById('instructions').classList.add('hidden'); document.getElementById('quiz').classList.remove('hidden'); showQuestion(currentQuestion); startTimer(); updateNavPanel(); debugLog("Quiz started successfully"); } catch (e) { console.error("Error starting quiz:", e); debugLog("Failed to start quiz: " + e.message); document.getElementById('error-message').innerHTML = "Error starting quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); document.getElementById('quiz').classList.add('hidden'); document.getElementById('instructions').classList.remove('hidden'); } } // Show question function showQuestion(index) { try { debugLog(`Showing question ${index + 1}`); currentQuestion = index; const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } document.getElementById('question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('question-text').innerHTML = q.text || "No question text available"; const imagesDiv = document.getElementById('question-images'); imagesDiv.innerHTML = q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg">`).join('') : ''; const optionsDiv = document.getElementById('options'); optionsDiv.innerHTML = q.options && q.options.length > 0 ? q.options.map(opt => ` <button class="option-btn w-full text-left p-3 border rounded-lg ${answers[index] === opt.label ? 'selected' : ''}" onclick="selectOption(${index}, '${opt.label}')" aria-label="Option ${opt.label}: ${opt.text}"> ${opt.label}. ${opt.text} </button> `).join('') : '<p class="text-red-500">No options available</p>'; document.getElementById('previous-btn').disabled = index === 0; document.getElementById('next-btn').disabled = index === questions.length - 1; document.getElementById('mark-review').classList.toggle('marked', markedForReview[index]); updateProgressBar(); saveProgress(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying question:", e); debugLog("Failed to display question: " + e.message); } } // Select option function selectOption(index, label) { try { debugLog(`Selecting option ${label} for question ${index + 1}`); answers[index] = label; const optionsDiv = document.getElementById('options'); const optionButtons = optionsDiv.querySelectorAll('.option-btn'); optionButtons.forEach(btn => { const btnLabel = btn.textContent.trim().split('.')[0]; btn.classList.toggle('selected', btnLabel === label); }); updateNavPanel(); saveProgress(); debugLog(`Option ${label} selected for question ${index + 1}`); } catch (e) { console.error("Error selecting option:", e); debugLog("Failed to select option: " + e.message); } } // Toggle mark for review function toggleMarkForReview() { try { debugLog(`Toggling mark for review on question ${currentQuestion + 1}`); markedForReview[currentQuestion] = !markedForReview[currentQuestion]; document.getElementById('mark-review').classList.toggle('marked', markedForReview[currentQuestion]); updateNavPanel(); saveProgress(); debugLog(`Mark for review toggled for question ${currentQuestion + 1}`); } catch (e) { console.error("Error marking for review:", e); debugLog("Failed to mark for review: " + e.message); } } // Navigate to previous question function showPreviousQuestion() { try { debugLog(`Navigating to previous question from ${currentQuestion + 1}`); if (currentQuestion > 0) { currentQuestion--; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to previous question:", e); debugLog("Failed to navigate to previous question: " + e.message); } } // Navigate to next question function showNextQuestion() { try { debugLog(`Navigating to next question from ${currentQuestion + 1}`); if (currentQuestion < questions.length - 1) { currentQuestion++; showQuestion(currentQuestion); } } catch (e) { console.error("Error navigating to next question:", e); debugLog("Failed to navigate to next question: " + e.message); } } // Handle question navigation click function handleQuestionNavClick(index) { try { debugLog(`Navigating to question ${index + 1} via nav panel`); showQuestion(index); toggleNavPanel(); } catch (e) { console.error("Error handling navigation click:", e); debugLog("Failed to navigate via nav panel: " + e.message); } } // Start timer function startTimer() { try { debugLog("Starting timer"); timerInterval = setInterval(() => { if (timeRemaining <= 0) { debugLog("Timer expired, submitting test"); clearInterval(timerInterval); submitTest(); } else { timeRemaining--; const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; document.getElementById('timer').innerHTML = `Time Remaining: <span>${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}</span>`; saveProgress(); } }, 1000); debugLog("Timer started successfully"); } catch (e) { console.error("Error starting timer:", e); debugLog("Failed to start timer: " + e.message); } } // Update progress bar function updateProgressBar() { try { debugLog("Updating progress bar"); const progress = ((currentQuestion + 1) / questions.length) * 100; document.getElementById('progress-bar').style.width = `${progress}%`; debugLog("Progress bar updated"); } catch (e) { console.error("Error updating progress bar:", e); debugLog("Failed to update progress bar: " + e.message); } } // Update quiz navigation panel function updateNavPanel() { try { debugLog("Updating quiz navigation panel"); const filter = document.getElementById('nav-filter').value; const navGrid = document.getElementById('nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="question-nav-btn ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleQuestionNavClick(${i})" aria-label="Go to Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Quiz navigation panel updated"); } catch (e) { console.error("Error updating quiz navigation panel:", e); debugLog("Failed to update quiz navigation panel: " + e.message); } } // Update results navigation panel function updateResultsNavPanel() { try { debugLog("Updating results navigation panel"); const filter = document.getElementById('results-nav-filter').value; const navGrid = document.getElementById('results-nav-grid'); navGrid.innerHTML = questions.map((_, i) => { if (filter === 'answered' && !answers[i]) return ''; if (filter === 'unanswered' && answers[i]) return ''; if (filter === 'marked' && !markedForReview[i]) return ''; return ` <button class="result-nav-btn-grid ${answers[i] ? 'answered' : 'unanswered'} ${markedForReview[i] ? 'marked-nav' : ''}" onclick="handleResultNavClick(${i})" aria-label="Go to Result for Question ${i + 1}"> ${i + 1} </button> `; }).join(''); debugLog("Results navigation panel updated"); } catch (e) { console.error("Error updating results navigation panel:", e); debugLog("Failed to update results navigation panel: " + e.message); } } // Toggle quiz navigation panel function toggleNavPanel() { try { debugLog("Toggling quiz navigation panel"); const navPanel = document.getElementById('nav-panel'); navPanel.classList.toggle('hidden'); debugLog("Quiz navigation panel toggled"); } catch (e) { console.error("Error toggling quiz navigation panel:", e); debugLog("Failed to toggle quiz navigation panel: " + e.message); } } // Toggle results navigation panel function toggleResultsNavPanel() { try { debugLog("Toggling results navigation panel"); const resultsNavPanel = document.getElementById('results-nav-panel'); resultsNavPanel.classList.toggle('hidden'); if (!resultsNavPanel.classList.contains('hidden')) { updateResultsNavPanel(); } debugLog("Results navigation panel toggled"); } catch (e) { console.error("Error toggling results navigation panel:", e); debugLog("Failed to toggle results navigation panel: " + e.message); } } // Handle result navigation click function handleResultNavClick(index) { try { debugLog(`Navigating to result for question ${index + 1} via nav panel`); showResults(index); toggleResultsNavPanel(); } catch (e) { console.error("Error handling result navigation click:", e); debugLog("Failed to navigate to result: " + e.message); } } // Show submit modal function showSubmitModal() { try { debugLog("Showing submit modal"); const attempted = answers.filter(a => a !== null).length; document.getElementById('attempted-count').textContent = attempted; document.getElementById('unattempted-count').textContent = questions.length - attempted; document.getElementById('submit-modal').classList.remove('hidden'); debugLog("Submit modal displayed"); } catch (e) { console.error("Error showing submit modal:", e); debugLog("Failed to show submit modal: " + e.message); } } // Close submit modal function closeSubmitModal() { try { debugLog("Closing submit modal"); document.getElementById('submit-modal').classList.add('hidden'); debugLog("Submit modal closed"); } catch (e) { console.error("Error closing submit modal:", e); debugLog("Failed to close submit modal: " + e.message); } } // Close exit modal function closeExitModal() { try { debugLog("Closing exit modal"); document.getElementById('exit-modal').classList.add('hidden'); debugLog("Exit modal closed"); } catch (e) { console.error("Error closing exit modal:", e); debugLog("Failed to close exit modal: " + e.message); } } // Submit test function submitTest() { try { debugLog("Submitting test"); clearInterval(timerInterval); document.getElementById('quiz').classList.add('hidden'); document.getElementById('submit-modal').classList.add('hidden'); document.getElementById('results').classList.remove('hidden'); showResults(0); // Start with first question // Trigger confetti animation confetti({ particleCount: 100, spread: 70, origin: { y: 0.6 } }); localStorage.removeItem(`quiz_${quizId}`); debugLog("Test submitted successfully"); } catch (e) { console.error("Error submitting test:", e); debugLog("Failed to submit test: " + e.message); } } function showResults(index) { try { debugLog(`Showing result for question ${index + 1}`); currentResultQuestion = index; let correct = 0, wrong = 0, unanswered = 0, marked = 0; answers.forEach((answer, i) => { const isCorrect = answer && questions[i].options.find(opt => opt.label === answer)?.correct; if (answer === null) unanswered++; else if (isCorrect) correct++; else wrong++; if (markedForReview[i]) marked++; }); const q = questions[index]; if (!q) { throw new Error(`Question ${index} is undefined`); } const userAnswer = answers[index]; const isCorrect = userAnswer && q.options.find(opt => opt.label === userAnswer)?.correct; const resultsContent = document.getElementById('results-content'); // Create scrollable container for explanation content resultsContent.innerHTML = ` <div class="border-4 ${isCorrect ? 'border-green-600 bg-green-100' : userAnswer ? 'border-red-600 bg-red-100' : 'border-gray-400 bg-gray-50'} p-4 rounded-lg overflow-hidden"> <p class="font-semibold">Question ${index + 1}: ${q.text || 'No question text'}</p> ${q.question_images && q.question_images.length > 0 ? q.question_images.map(url => `<img src="${url}" alt="Question Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} <p><strong>Your Answer:</strong> ${userAnswer ? `${userAnswer}. ${q.options.find(opt => opt.label === userAnswer)?.text || 'Invalid option'}` : 'Unanswered'}</p> <p><strong>Correct Answer:</strong> ${q.correct_answer || 'Unknown'}</p> <!-- Scrollable container for explanation --> <div class="mt-2 overflow-x-auto"> ${q.explanation || 'No explanation available'} </div> ${q.explanation_images && q.explanation_images.length > 0 ? q.explanation_images.map(url => `<img src="${url}" alt="Explanation Image" class="max-w-full h-auto rounded-lg my-2">`).join('') : ''} ${q.video ? ` <button class="play-video bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadVideo(this, '${q.video}', 'video-${index}')" aria-label="Play explanation video for Question ${index + 1}"> Play Video Explanation </button> <div id="video-${index}" class="video-container mt-2"></div> ` : '<p class="text-gray-500 mt-2">No video available</p>'} ${q.audio ? ` <button class="play-audio bg-[#2c5281] text-white px-4 py-2 rounded-lg mt-2" onclick="loadAudio(this, '${q.audio}', 'audio-${index}')" aria-label="Play audio explanation for Question ${index + 1}"> Play Audio Explanation </button> <div id="audio-${index}" class="audio-container mt-2"></div> ` : ''} </div> `; document.getElementById('correct-count').textContent = correct; document.getElementById('wrong-count').textContent = wrong; document.getElementById('unanswered-count').textContent = unanswered; document.getElementById('marked-count').textContent = marked; document.getElementById('result-question-number').innerHTML = `Question <span>${index + 1}</span> of ${questions.length}`; document.getElementById('prev-result').disabled = index === 0; document.getElementById('next-result').disabled = index === questions.length - 1; updateResultsNavPanel(); window.scrollTo({ top: 0, behavior: 'smooth' }); debugLog(`Result for question ${index + 1} displayed successfully`); } catch (e) { console.error("Error displaying result:", e); debugLog("Failed to display result: " + e.message); } } // Navigate to previous result function showPreviousResult() { try { debugLog(`Navigating to previous result from question ${currentResultQuestion + 1}`); if (currentResultQuestion > 0) { showResults(currentResultQuestion - 1); } } catch (e) { console.error("Error navigating to previous result:", e); debugLog("Failed to navigate to previous result: " + e.message); } } // Navigate to next result function showNextResult() { try { debugLog(`Navigating to next result from question ${currentResultQuestion + 1}`); if (currentResultQuestion < questions.length - 1) { showResults(currentResultQuestion + 1); } } catch (e) { console.error("Error navigating to next result:", e); debugLog("Failed to navigate to next result: " + e.message); } } // Lazy-load video function loadVideo(button, videoUrl, containerId) { try { debugLog(`Loading video for ${containerId}: ${videoUrl}`); if (!videoUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No video available</p>`; button.remove(); debugLog("No video URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <div class="video-loading"></div> <video controls class="w-full max-w-[600px] rounded-lg" preload="metadata" aria-label="Video explanation"> <source src="${videoUrl}" type="${videoUrl.endsWith('.m3u8') ? 'application/x-mpegURL' : 'video/mp4'}"> Your browser does not support the video tag. </video> `; container.classList.add('active'); button.remove(); // Initialize HLS.js for .m3u8 videos const video = container.querySelector('video'); if (videoUrl.endsWith('.m3u8') && Hls.isSupported()) { const hls = new Hls(); hls.loadSource(videoUrl); hls.attachMedia(video); hls.on(Hls.Events.ERROR, (event, data) => { console.error("HLS.js error:", data); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("HLS.js error: " + JSON.stringify(data)); }); } else if (videoUrl.endsWith('.m3u8') && video.canPlayType('application/vnd.apple.mpegurl')) { video.src = videoUrl; } // Handle video load errors video.onerror = () => { console.error("Video load error for URL:", videoUrl); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; debugLog("Video load error for URL: " + videoUrl); }; // Remove loading spinner when video is ready video.onloadedmetadata = () => { container.querySelector('.video-loading').remove(); debugLog("Video loaded successfully"); }; } catch (e) { console.error("Error loading video:", e); debugLog("Failed to load video: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading video. <a href="${videoUrl}" target="_blank" aria-label="Open video in new tab">Open video</a></p>`; } } // Lazy-load audio function loadAudio(button, audioUrl, containerId) { try { debugLog(`Loading audio for ${containerId}: ${audioUrl}`); if (!audioUrl) { const container = document.getElementById(containerId); container.innerHTML = `<p class="text-gray-500">No audio available</p>`; button.remove(); debugLog("No audio URL provided"); return; } const container = document.getElementById(containerId); container.innerHTML = ` <audio controls class="w-full max-w-[600px]" preload="metadata" aria-label="Audio explanation"> <source src="${audioUrl}" type="audio/mpeg"> Your browser does not support the audio tag. </audio> `; container.classList.add('active'); button.remove(); // Handle audio load errors const audio = container.querySelector('audio'); audio.onerror = () => { console.error("Audio load error for URL:", audioUrl); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; debugLog("Audio load error for URL: " + audioUrl); }; debugLog("Audio loaded successfully"); } catch (e) { console.error("Error loading audio:", e); debugLog("Failed to load audio: " + e.message); const container = document.getElementById(containerId); container.innerHTML = `<p class="text-red-500">Error loading audio. <a href="${audioUrl}" target="_blank" aria-label="Open audio in new tab">Open audio</a></p>`; } } // Toggle dark mode function toggleTheme() { try { debugLog("Toggling theme"); document.documentElement.classList.toggle('dark'); localStorage.setItem('theme', document.documentElement.classList.contains('dark') ? 'dark' : 'light'); debugLog("Theme toggled successfully"); } catch (e) { console.error("Error toggling theme:", e); debugLog("Failed to toggle theme: " + e.message); } } // Load theme preference function loadTheme() { try { debugLog("Loading theme preference"); const theme = localStorage.getItem('theme'); if (theme === 'dark') { document.documentElement.classList.add('dark'); } debugLog("Theme loaded successfully"); } catch (e) { console.error("Error loading theme:", e); debugLog("Failed to load theme: " + e.message); } } // Initialize on DOM content loaded window.addEventListener('DOMContentLoaded', () => { try { debugLog("DOM content loaded, initializing quiz"); loadTheme(); initQuiz(); } catch (e) { console.error("Error during DOMContentLoaded:", e); debugLog("Failed to initialize on DOMContentLoaded: " + e.message); document.getElementById('error-message').innerHTML = "Error initializing quiz. Please check the console for details or contact support."; document.getElementById('error-message').classList.remove('hidden'); } }); </script> </body> </html>" frameborder="0" width="100%" height="2000px">